This is an automated email from the ASF dual-hosted git repository. shuwenwei pushed a commit to branch skipNotSatisfiedTimeRange in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 3c787e2d62e8ed3ac073e63feab2ac79456e7d91 Author: shuwenwei <[email protected]> AuthorDate: Mon Oct 13 16:04:44 2025 +0800 mark deleted rows in timeInvalidInfo --- .../db/utils/datastructure/AlignedTVList.java | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java index 15fa7696e39..9a7e86c99ba 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java @@ -1880,7 +1880,8 @@ public abstract class AlignedTVList extends TVList { TimeColumnBuilder timeBuilder = builder.getTimeColumnBuilder(); int validRowCount = 0; - // duplicated time or deleted time are all invalid, true if we don't need this row + // duplicated time or deleted row or time that do not match the filter are all invalid, true + // if we don't need this row LazyBitMap timeInvalidInfo = null; int[] deleteCursor = {0}; @@ -1891,12 +1892,16 @@ public abstract class AlignedTVList extends TVList { if (validRowCount >= maxNumberOfPointsInPage || isCurrentTimeExceedTimeRange(time)) { break; } - // skip empty row - if (allValueColDeletedMap != null - && allValueColDeletedMap.isMarked(getValueIndex(getScanOrderIndex(index)))) { - continue; - } - if (isTimeDeleted(getScanOrderIndex(index)) || !isTimeSatisfied(time)) { + // skip invalid row + if ((allValueColDeletedMap != null + && allValueColDeletedMap.isMarked(getValueIndex(getScanOrderIndex(index)))) + || isTimeDeleted(getScanOrderIndex(index)) + || !isTimeSatisfied(time)) { + timeInvalidInfo = + timeInvalidInfo == null + ? new LazyBitMap(index, maxNumberOfPointsInPage, rows - 1) + : timeInvalidInfo; + timeInvalidInfo.mark(index); continue; } int nextRowIndex = index + 1; @@ -1905,6 +1910,11 @@ public abstract class AlignedTVList extends TVList { && allValueColDeletedMap.isMarked( getValueIndex(getScanOrderIndex(nextRowIndex)))) || (isTimeDeleted(getScanOrderIndex(nextRowIndex)) || !isTimeSatisfied(time)))) { + timeInvalidInfo = + timeInvalidInfo == null + ? new LazyBitMap(nextRowIndex, maxNumberOfPointsInPage, rows - 1) + : timeInvalidInfo; + timeInvalidInfo.mark(nextRowIndex); nextRowIndex++; } if ((nextRowIndex == rows || time != getTime(getScanOrderIndex(nextRowIndex))) @@ -1939,15 +1949,7 @@ public abstract class AlignedTVList extends TVList { ColumnBuilder valueBuilder = builder.getColumnBuilder(columnIndex); currentWriteRowIndex = 0; for (int sortedRowIndex = startIndex; sortedRowIndex < index; sortedRowIndex++) { - // skip empty row - if ((allValueColDeletedMap != null - && allValueColDeletedMap.isMarked( - getValueIndex(getScanOrderIndex(sortedRowIndex)))) - || (isTimeDeleted(getScanOrderIndex(sortedRowIndex)) - || !isTimeSatisfied(getTime(getScanOrderIndex(sortedRowIndex))))) { - continue; - } - // skip time duplicated or totally deleted rows + // skip time duplicated or invalid rows if (Objects.nonNull(timeInvalidInfo)) { if (!outer.isNullValue( getValueIndex(getScanOrderIndex(sortedRowIndex)), validColumnIndex)) { @@ -1964,7 +1966,7 @@ public abstract class AlignedTVList extends TVList { } } // timeInvalidInfo was constructed when traversing the time column before. It can be - // reused when traversing each value column to skip deleted rows or non-last rows with + // reused when traversing each value column to skip invalid rows or non-last rows with // duplicated timestamps. // Until the last duplicate timestamp is encountered, it will be skipped here. if (timeInvalidInfo.isMarked(sortedRowIndex)) {
