liuminghui233 commented on code in PR #9141:
URL: https://github.com/apache/iotdb/pull/9141#discussion_r1123138316
##########
server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/AggregationUtil.java:
##########
@@ -104,16 +106,26 @@ public static Pair<Boolean, TsBlock>
calculateAggregationFromRawData(
inputTsBlock = skipPointsOutOfTimeRange(inputTsBlock, curTimeRange,
ascending);
}
- int lastReadRowIndex = 0;
+ // Get the row which need to be processed by aggregator
+ IWindow curWindow = new TimeWindow(curTimeRange);
+ TimeColumn timeColumn = inputTsBlock.getTimeColumn();
+ int lastIndexToProcess = 0;
+ for (int i = 0; i < inputTsBlock.getPositionCount(); i++) {
+ if (!curWindow.satisfy(timeColumn, i)) {
+ break;
Review Comment:
consider binary search algorithm
##########
server/src/main/java/org/apache/iotdb/db/mpp/aggregation/slidingwindow/SlidingWindowAggregator.java:
##########
@@ -54,7 +54,7 @@ protected SlidingWindowAggregator(
}
@Override
Review Comment:
consider not letting SlidingWindowAggregator extend Aggregator, maybe the
code will be clearer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]