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


##########
server/src/main/java/org/apache/iotdb/db/mpp/aggregation/LastValueDescAccumulator.java:
##########
@@ -39,87 +39,207 @@ public void reset() {
     super.reset();
   }
 
-  protected int addIntInput(Column[] column, TimeRange timeRange) {
-    for (int i = 0; i < column[0].getPositionCount(); i++) {
-      long curTime = column[0].getLong(i);
-      if (curTime > timeRange.getMax() || curTime < timeRange.getMin()) {
-        return i;
+  protected int addIntInput(Column[] column, IWindow curWindow) {
+    int windowControlColumnIndex = curWindow.getControlColumnIndex();
+    int curPositionCount = column[windowControlColumnIndex].getPositionCount();
+
+    if (curWindow.isTimeWindow()) {

Review Comment:
   I've changed it.



##########
server/src/main/java/org/apache/iotdb/db/mpp/aggregation/LastValueDescAccumulator.java:
##########
@@ -39,87 +39,207 @@ public void reset() {
     super.reset();
   }
 
-  protected int addIntInput(Column[] column, TimeRange timeRange) {
-    for (int i = 0; i < column[0].getPositionCount(); i++) {
-      long curTime = column[0].getLong(i);
-      if (curTime > timeRange.getMax() || curTime < timeRange.getMin()) {
-        return i;
+  protected int addIntInput(Column[] column, IWindow curWindow) {
+    int windowControlColumnIndex = curWindow.getControlColumnIndex();
+    int curPositionCount = column[windowControlColumnIndex].getPositionCount();
+
+    if (curWindow.isTimeWindow()) {

Review Comment:
   I've optimized it.



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