Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,9 @@ public TsBlock nextBatch() {
case BOOLEAN:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand All @@ -831,6 +834,9 @@ && isTimeSatisfied(time)) {
case DATE:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand All @@ -849,6 +855,9 @@ && isTimeSatisfied(time)) {
case TIMESTAMP:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand All @@ -866,6 +875,9 @@ && isTimeSatisfied(time)) {
case FLOAT:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand All @@ -885,6 +897,9 @@ && isTimeSatisfied(time)) {
case DOUBLE:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand All @@ -906,6 +921,9 @@ && isTimeSatisfied(time)) {
case STRING:
while (index < rows && builder.getPositionCount() < maxNumberOfPointsInPage) {
long time = getTime(getScanOrderIndex(index));
if (isCurrentTimeExceedTimeRange(time)) {
break;
}
if (!isNullValue(getValueIndex(getScanOrderIndex(index)))
&& !isPointDeleted(time, deletionList, deleteCursor, scanOrder)
&& isLatestPoint(index, time)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,15 @@ private void testAligned(
List<Statistics<? extends Serializable>> pageStatisticsList = chunk.getTimeStatisticsList();
int count = 0;
long offset = paginationController.getCurOffset();
if (!scanOrder.isAscending()) {
Collections.reverse(pageStatisticsList);
}
for (Statistics<? extends Serializable> statistics : pageStatisticsList) {
if (statistics.getStartTime() <= statistics.getEndTime()) {
memPointIterator.setCurrentPageTimeRange(
new TimeRange(statistics.getStartTime(), statistics.getEndTime()));
}
TimeRange currentTimeRange =
(statistics.getStartTime() <= statistics.getEndTime())
? new TimeRange(statistics.getStartTime(), statistics.getEndTime())
: null;
memPointIterator.setCurrentPageTimeRange(currentTimeRange);
while (memPointIterator.hasNextBatch()) {
TsBlock tsBlock = memPointIterator.nextBatch();
for (int i = 0; i < tsBlock.getPositionCount(); i++) {
Expand All @@ -635,6 +639,8 @@ private void testAligned(
count++;
}
long currentTimestamp = tsBlock.getTimeByIndex(i);
Assert.assertTrue(
currentTimeRange == null || currentTimeRange.contains(currentTimestamp));
Long int64Value = tsBlock.getColumn(0).isNull(i) ? null : tsBlock.getColumn(0).getLong(i);
Boolean boolValue =
tsBlock.getColumn(1).isNull(i) ? null : tsBlock.getColumn(1).getBoolean(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,15 @@ private void testNonAligned(
List<Statistics<? extends Serializable>> pageStatisticsList = chunk.getPageStatisticsList();
int count = 0;
long offset = paginationController.getCurOffset();
if (!scanOrder.isAscending()) {
Collections.reverse(pageStatisticsList);
}
for (Statistics<? extends Serializable> statistics : pageStatisticsList) {
memPointIterator.setCurrentPageTimeRange(
new TimeRange(statistics.getStartTime(), statistics.getEndTime()));
TimeRange currentTimeRange =
(statistics.getStartTime() <= statistics.getEndTime())
? new TimeRange(statistics.getStartTime(), statistics.getEndTime())
: null;
memPointIterator.setCurrentPageTimeRange(currentTimeRange);
while (memPointIterator.hasNextBatch()) {
TsBlock tsBlock = memPointIterator.nextBatch();
for (int i = 0; i < tsBlock.getPositionCount(); i++) {
Expand All @@ -512,6 +518,7 @@ private void testNonAligned(
count++;
}
long currentTimestamp = tsBlock.getTimeByIndex(i);
Assert.assertTrue(currentTimeRange.contains(currentTimestamp));
long value = tsBlock.getColumn(0).getLong(i);
Assert.assertEquals(currentTimestamp, value);
if (globalTimeFilter != null) {
Expand Down