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/11/17 04:24:28 UTC

[iotdb] 01/02: tmp saved

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

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

commit 242d167d96cefc153b3c5595bfa9331cbab98149
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Wed Nov 16 14:22:44 2022 +0800

    tmp saved
---
 .../db/mpp/plan/planner/distribution/SourceRewriter.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
index fd3236663e..338c02a00e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/distribution/SourceRewriter.java
@@ -88,6 +88,10 @@ public class SourceRewriter extends SimplePlanNodeRewriter<DistributionPlanConte
         node.getDevices().size() == node.getChildren().size(),
         "size of devices and its children in DeviceViewNode should be same");
 
+    // If the logicalPlan is mixed by DeviceView and Aggregation, it should be processed by a
+    // special logic.
+    if (isAggregationQuery(node)) {}
+
     Set<TRegionReplicaSet> relatedDataRegions = new HashSet<>();
 
     List<DeviceViewSplit> deviceViewSplits = new ArrayList<>();
@@ -541,10 +545,13 @@ public class SourceRewriter extends SimplePlanNodeRewriter<DistributionPlanConte
     return root;
   }
 
-  private boolean isAggregationQuery(TimeJoinNode node) {
+  private boolean isAggregationQuery(PlanNode node) {
+    if (node instanceof SeriesAggregationScanNode
+        || node instanceof AlignedSeriesAggregationScanNode) {
+      return true;
+    }
     for (PlanNode child : node.getChildren()) {
-      if (child instanceof SeriesAggregationScanNode
-          || child instanceof AlignedSeriesAggregationScanNode) {
+      if (isAggregationQuery(child)) {
         return true;
       }
     }