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/05/22 09:15:10 UTC

[iotdb] branch xingtanzjr/agg_distribution_plan updated: spotless

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

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


The following commit(s) were added to refs/heads/xingtanzjr/agg_distribution_plan by this push:
     new 471249c59d spotless
471249c59d is described below

commit 471249c59df32f087304df380f155799642ffd71
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Sun May 22 17:15:00 2022 +0800

    spotless
---
 .../db/mpp/plan/planner/DistributionPlanner.java   |  4 ---
 .../db/mpp/plan/plan/DistributionPlannerTest.java  | 36 ++++++++++++++--------
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/DistributionPlanner.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/DistributionPlanner.java
index 065110d231..88b5b38e99 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/DistributionPlanner.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/DistributionPlanner.java
@@ -32,7 +32,6 @@ import org.apache.iotdb.db.mpp.plan.planner.plan.PlanFragment;
 import org.apache.iotdb.db.mpp.plan.planner.plan.SubPlan;
 import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNode;
 import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNodeId;
-import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNodeUtil;
 import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanVisitor;
 import org.apache.iotdb.db.mpp.plan.planner.plan.node.SimplePlanNodeRewriter;
 import org.apache.iotdb.db.mpp.plan.planner.plan.node.WritePlanNode;
@@ -102,11 +101,8 @@ public class DistributionPlanner {
   }
 
   public DistributedQueryPlan planFragments() {
-    System.out.println(PlanNodeUtil.nodeToString(logicalPlan.getRootNode()));
     PlanNode rootAfterRewrite = rewriteSource();
-    System.out.println(PlanNodeUtil.nodeToString(rootAfterRewrite));
     PlanNode rootWithExchange = addExchangeNode(rootAfterRewrite);
-    System.out.println(PlanNodeUtil.nodeToString(rootWithExchange));
     if (analysis.getStatement() instanceof QueryStatement) {
       analysis
           .getRespDatasetHeader()
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/plan/plan/DistributionPlannerTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/plan/plan/DistributionPlannerTest.java
index ba1e0df5fb..06063b85cf 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/plan/plan/DistributionPlannerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/plan/plan/DistributionPlannerTest.java
@@ -461,11 +461,15 @@ public class DistributionPlannerTest {
 
     Map<String, List<String>> expectedDescriptorValue = new HashMap<>();
     expectedDescriptorValue.put(groupedPath, Arrays.asList(groupedPath, d3s1Path, d4s1Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue, (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue,
+        (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
 
     Map<String, List<String>> expectedDescriptorValue2 = new HashMap<>();
     expectedDescriptorValue2.put(groupedPath, Arrays.asList(d3s1Path, d4s1Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue2, (GroupByLevelNode) fragmentInstances.get(1).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue2,
+        (GroupByLevelNode) fragmentInstances.get(1).getFragment().getRoot().getChildren().get(0));
   }
 
   @Test
@@ -486,14 +490,12 @@ public class DistributionPlannerTest {
                 new GroupByLevelDescriptor(
                     AggregationType.COUNT,
                     AggregationStep.FINAL,
-                    Collections.singletonList(
-                        new TimeSeriesOperand(new PartialPath(d1s1Path))),
+                    Collections.singletonList(new TimeSeriesOperand(new PartialPath(d1s1Path))),
                     new TimeSeriesOperand(new PartialPath(groupedPathS1))),
                 new GroupByLevelDescriptor(
                     AggregationType.COUNT,
                     AggregationStep.FINAL,
-                    Collections.singletonList(
-                        new TimeSeriesOperand(new PartialPath(d1s2Path))),
+                    Collections.singletonList(new TimeSeriesOperand(new PartialPath(d1s2Path))),
                     new TimeSeriesOperand(new PartialPath(groupedPathS2)))));
     Analysis analysis = constructAnalysis();
     MPPQueryContext context =
@@ -511,12 +513,16 @@ public class DistributionPlannerTest {
     Map<String, List<String>> expectedDescriptorValue = new HashMap<>();
     expectedDescriptorValue.put(groupedPathS1, Arrays.asList(groupedPathS1, d1s1Path));
     expectedDescriptorValue.put(groupedPathS2, Arrays.asList(groupedPathS2, d1s2Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue, (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue,
+        (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
 
     Map<String, List<String>> expectedDescriptorValue2 = new HashMap<>();
     expectedDescriptorValue2.put(groupedPathS1, Collections.singletonList(d1s1Path));
     expectedDescriptorValue2.put(groupedPathS2, Collections.singletonList(d1s2Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue2, (GroupByLevelNode) fragmentInstances.get(1).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue2,
+        (GroupByLevelNode) fragmentInstances.get(1).getFragment().getRoot().getChildren().get(0));
   }
 
   @Test
@@ -546,8 +552,7 @@ public class DistributionPlannerTest {
                 new GroupByLevelDescriptor(
                     AggregationType.COUNT,
                     AggregationStep.FINAL,
-                    Collections.singletonList(
-                        new TimeSeriesOperand(new PartialPath(d1s2Path))),
+                    Collections.singletonList(new TimeSeriesOperand(new PartialPath(d1s2Path))),
                     new TimeSeriesOperand(new PartialPath(groupedPathS2)))));
     Analysis analysis = constructAnalysis();
     MPPQueryContext context =
@@ -566,15 +571,20 @@ public class DistributionPlannerTest {
     Map<String, List<String>> expectedDescriptorValue = new HashMap<>();
     expectedDescriptorValue.put(groupedPathS1, Arrays.asList(groupedPathS1, d1s1Path, d2s1Path));
     expectedDescriptorValue.put(groupedPathS2, Arrays.asList(groupedPathS2, d1s2Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue, (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue,
+        (GroupByLevelNode) fragmentInstances.get(0).getFragment().getRoot().getChildren().get(0));
 
     Map<String, List<String>> expectedDescriptorValue2 = new HashMap<>();
     expectedDescriptorValue2.put(groupedPathS1, Collections.singletonList(d1s1Path));
     expectedDescriptorValue2.put(groupedPathS2, Collections.singletonList(d1s2Path));
-    verifyGroupByLevelDescriptor(expectedDescriptorValue2, (GroupByLevelNode) fragmentInstances.get(2).getFragment().getRoot().getChildren().get(0));
+    verifyGroupByLevelDescriptor(
+        expectedDescriptorValue2,
+        (GroupByLevelNode) fragmentInstances.get(2).getFragment().getRoot().getChildren().get(0));
   }
 
-  private void verifyGroupByLevelDescriptor(Map<String, List<String>> expected, GroupByLevelNode node) {
+  private void verifyGroupByLevelDescriptor(
+      Map<String, List<String>> expected, GroupByLevelNode node) {
     List<GroupByLevelDescriptor> descriptors = node.getGroupByLevelDescriptors();
     assertEquals(expected.size(), descriptors.size());
     for (GroupByLevelDescriptor descriptor : descriptors) {