You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/06/02 03:38:42 UTC

[iotdb] 01/01: handle null() in aggregationOp

This is an automated email from the ASF dual-hosted git repository.

xiangweiwei pushed a commit to branch aggOp
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 5dae4b57b96572948aa1fde0082bfe63c8990ba8
Author: Alima777 <wx...@gmail.com>
AuthorDate: Thu Jun 2 11:38:28 2022 +0800

    handle null() in aggregationOp
---
 .../db/mpp/execution/operator/process/AggregationOperator.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
index 3b5beb32eb..73ac2bb3c1 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
@@ -98,7 +98,13 @@ public class AggregationOperator implements ProcessOperator {
     // update input tsBlock
     curTimeRange = timeRangeIterator.nextTimeRange();
     for (int i = 0; i < inputOperatorsCount; i++) {
+      if (inputTsBlocks[i] != null) {
+        continue;
+      }
       inputTsBlocks[i] = children.get(i).next();
+      if (inputTsBlocks[i] == null) {
+        return null;
+      }
     }
     // consume current input tsBlocks
     for (Aggregator aggregator : aggregators) {
@@ -106,6 +112,9 @@ public class AggregationOperator implements ProcessOperator {
       aggregator.processTsBlocks(inputTsBlocks);
     }
     // output result from aggregator
+    for (int i = 0; i < inputOperatorsCount; i++) {
+      inputTsBlocks[i] = null;
+    }
     return updateResultTsBlockFromAggregators(tsBlockBuilder, aggregators, timeRangeIterator);
   }