JackieTien97 commented on code in PR #8613:
URL: https://github.com/apache/iotdb/pull/8613#discussion_r1058034647


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/PlanFragment.java:
##########
@@ -98,6 +100,10 @@ public TRegionReplicaSet getTargetRegion() {
     return getNodeRegion(planNodeTree);
   }
 
+  public TDataNodeLocation getTargetLocation() {

Review Comment:
   add java doc for this method.



##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java:
##########
@@ -1111,4 +1115,61 @@ public LogicalPlanBuilder planPathsUsingTemplateSource(
             context.getQueryId().genPlanNodeId(), pathPatternList, templateId);
     return this;
   }
+
+  public LogicalPlanBuilder planOneChildOrderBy(
+      OrderByParameter orderByParameter, List<String> outputColumns) {
+    if (orderByParameter.isEmpty()) {
+      return this;
+    }
+    this.root =
+        new MergeSortNode(
+            context.getQueryId().genPlanNodeId(),
+            Collections.singletonList(this.root),
+            orderByParameter,
+            outputColumns);
+    return this;
+  }
+
+  public LogicalPlanBuilder planShowQueries(Analysis analysis, 
ShowQueriesStatement statement) {
+    List<TDataNodeLocation> dataNodeLocations = 
analysis.getRunningDataNodeLocations();
+    if (dataNodeLocations.size() == 1) {
+      this.root =
+          planSingleShowQueries(dataNodeLocations.get(0))
+              .planFilterAndTransform(
+                  analysis.getWhereExpression(),
+                  analysis.getSourceExpressions(),
+                  false,
+                  statement.getZoneId(),
+                  Ordering.ASC)
+              .getRoot();
+    } else {
+      HorizontallyConcatNode concatNode =
+          new HorizontallyConcatNode(context.getQueryId().genPlanNodeId());
+      dataNodeLocations.forEach(
+          dataNodeLocation ->
+              concatNode.addChild(
+                  new LogicalPlanBuilder(analysis, context)
+                      .planSingleShowQueries(dataNodeLocation)
+                      .planFilterAndTransform(
+                          analysis.getWhereExpression(),
+                          analysis.getSourceExpressions(),
+                          false,
+                          statement.getZoneId(),
+                          Ordering.ASC)
+                      .getRoot()));
+      this.root = concatNode;
+    }
+
+    ColumnHeaderConstant.showQueriesColumnHeaders.forEach(
+        columnHeader ->
+            context
+                .getTypeProvider()
+                .setType(columnHeader.getColumnName(), 
columnHeader.getColumnType()));
+    return this;
+  }
+
+  public LogicalPlanBuilder planSingleShowQueries(TDataNodeLocation 
dataNodeLocation) {

Review Comment:
   ```suggestion
     private LogicalPlanBuilder planSingleShowQueries(TDataNodeLocation 
dataNodeLocation) {
   ```



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