You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "ycycse (via GitHub)" <gi...@apache.org> on 2023/04/26 14:15:35 UTC

[GitHub] [iotdb] ycycse commented on a diff in pull request #9567: [IOTDB-5765] Support ORDER BY expression

ycycse commented on code in PR #9567:
URL: https://github.com/apache/iotdb/pull/9567#discussion_r1177949297


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java:
##########
@@ -1200,4 +1197,36 @@ private LogicalPlanBuilder planSingleShowQueries(TDataNodeLocation dataNodeLocat
     this.root = new ShowQueriesNode(context.getQueryId().genPlanNodeId(), dataNodeLocation);
     return this;
   }
+
+  public LogicalPlanBuilder planOrderBy(
+      QueryStatement queryStatement,
+      Set<Expression> orderByExpressions,
+      Set<Expression> selectExpression) {
+    // only the order by clause having expression needs a sortNode
+    if (!queryStatement.hasOrderByExpression()) {
+      return this;
+    }
+
+    List<SortItem> sortItems = queryStatement.getSortItemList();
+    queryStatement.updateSortItems(orderByExpressions);

Review Comment:
   done



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org