ZhanGHanG9991 commented on code in PR #7277:
URL: https://github.com/apache/iotdb/pull/7277#discussion_r969556912


##########
server/src/main/java/org/apache/iotdb/db/mpp/aggregation/Aggregator.java:
##########
@@ -128,20 +126,27 @@ public TSDataType[] getOutputType() {
   }
 
   public void reset() {
-    curTimeRange = new TimeRange(0, Long.MAX_VALUE);
+    curWindow = null;
     accumulator.reset();
   }
 
   public boolean hasFinalResult() {
+    // For other window (SessionWindow, CountWindow and StateWindow), we cannot
+    // precompute where the window ends, so we cannot judge whether the 
aggregation method
+    // has been calculated.
+    if (!curWindow.isTimeWindow()) {
+      return false;
+    }
     return accumulator.hasFinalResult();

Review Comment:
   I've added `hasFinalResult()` in IWindow to avoid `instance of`.



-- 
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]

Reply via email to