This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch rc/1.2.1 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit eb5005415e4d9096e854138ac5b7b3f7c7168a31 Author: HTHou <[email protected]> AuthorDate: Mon Aug 21 16:19:50 2023 +0800 Revert "[To rel/1.2] [IOTDB-6112] Fix Limit & Offset push down doesn't take effect while there exist time filter" This reverts commit 72e09fba536609d421db13104ba740d4729e614a. --- .../operator/source/AlignedSeriesScanUtil.java | 18 ++++++++++-------- .../read/reader/chunk/MemAlignedPageReader.java | 14 ++++++-------- .../tsfile/read/reader/page/AlignedPageReader.java | 16 +++++++--------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/AlignedSeriesScanUtil.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/AlignedSeriesScanUtil.java index d36de2e4bf7..360211805bb 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/AlignedSeriesScanUtil.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/AlignedSeriesScanUtil.java @@ -141,11 +141,12 @@ public class AlignedSeriesScanUtil extends SeriesScanUtil { && !isFileOverlapped() && !firstTimeSeriesMetadata.isModified()) { Filter queryFilter = scanOptions.getQueryFilter(); - Statistics statistics = firstTimeSeriesMetadata.getStatistics(); - if (queryFilter == null || queryFilter.allSatisfy(statistics)) { + if (queryFilter != null) { + if (!queryFilter.satisfy(firstTimeSeriesMetadata.getStatistics())) { + skipCurrentFile(); + } + } else { skipOffsetByTimeSeriesMetadata(); - } else if (!queryFilter.satisfy(statistics)) { - skipCurrentFile(); } } } @@ -177,11 +178,12 @@ public class AlignedSeriesScanUtil extends SeriesScanUtil { protected void filterFirstChunkMetadata() throws IOException { if (firstChunkMetadata != null && !isChunkOverlapped() && !firstChunkMetadata.isModified()) { Filter queryFilter = scanOptions.getQueryFilter(); - Statistics statistics = firstChunkMetadata.getStatistics(); - if (queryFilter == null || queryFilter.allSatisfy(statistics)) { + if (queryFilter != null) { + if (!queryFilter.satisfy(firstChunkMetadata.getStatistics())) { + skipCurrentChunk(); + } + } else { skipOffsetByChunkMetadata(); - } else if (!queryFilter.satisfy(statistics)) { - skipCurrentChunk(); } } } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedPageReader.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedPageReader.java index b1bba47f129..6bce32c0a08 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedPageReader.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedPageReader.java @@ -99,16 +99,17 @@ public class MemAlignedPageReader implements IPageReader, IAlignedPageReader { } private boolean pageSatisfy() { - Statistics<? extends Serializable> statistics = getStatistics(); - if (valueFilter == null || valueFilter.allSatisfy(statistics)) { + if (valueFilter != null) { + return valueFilter.satisfy(getStatistics()); + } else { // For aligned series, When we only read some measurements under an aligned device, if the // values of these queried measurements at a timestamp are all null, the timestamp will not be // selected. // NOTE: if we change the read semantic in the future for aligned series, we need to remove // this check here. long rowCount = getTimeStatistics().getCount(); - for (Statistics<? extends Serializable> vStatistics : getValueStatisticsList()) { - if (vStatistics == null || vStatistics.hasNullValue(rowCount)) { + for (Statistics<? extends Serializable> statistics : getValueStatisticsList()) { + if (statistics == null || statistics.hasNullValue(rowCount)) { return true; } } @@ -117,12 +118,9 @@ public class MemAlignedPageReader implements IPageReader, IAlignedPageReader { if (paginationController.hasCurOffset(rowCount)) { paginationController.consumeOffset(rowCount); return false; - } else { - return true; } - } else { - return valueFilter.satisfy(statistics); } + return true; } @Override diff --git a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/AlignedPageReader.java b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/AlignedPageReader.java index 0a93e92f423..8064db9748f 100644 --- a/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/AlignedPageReader.java +++ b/iotdb-core/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/page/AlignedPageReader.java @@ -118,16 +118,18 @@ public class AlignedPageReader implements IPageReader, IAlignedPageReader { } private boolean pageSatisfy() { - Statistics statistics = getStatistics(); - if (filter == null || filter.allSatisfy(statistics)) { + if (filter != null) { + // TODO accept valueStatisticsList to filter + return filter.satisfy(getStatistics()); + } else { // For aligned series, When we only query some measurements under an aligned device, if the // values of these queried measurements at a timestamp are all null, the timestamp will not be // selected. // NOTE: if we change the query semantic in the future for aligned series, we need to remove // this check here. long rowCount = getTimeStatistics().getCount(); - for (Statistics vStatistics : getValueStatisticsList()) { - if (vStatistics == null || vStatistics.hasNullValue(rowCount)) { + for (Statistics statistics : getValueStatisticsList()) { + if (statistics == null || statistics.hasNullValue(rowCount)) { return true; } } @@ -136,13 +138,9 @@ public class AlignedPageReader implements IPageReader, IAlignedPageReader { if (paginationController.hasCurOffset(rowCount)) { paginationController.consumeOffset(rowCount); return false; - } else { - return true; } - } else { - // TODO accept valueStatisticsList to filter - return filter.satisfy(statistics); } + return true; } @Override
