zhengshiJ commented on code in PR #10227:
URL: https://github.com/apache/doris/pull/10227#discussion_r901410797


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -132,11 +153,18 @@ private LogicalPlan plan(ParserRuleContext tree) {
     public LogicalPlan visitQuery(QueryContext ctx) {
         Supplier<LogicalPlan> f = () -> {
             // TODO: need to add withQueryResultClauses and withCTE
-            return plan(ctx.queryTerm());
+            LogicalPlan query = plan(ctx.queryTerm());
+            LogicalPlan queryOrganization = 
withQueryOrganization(ctx.queryOrganization(), query);
+            return queryOrganization == null ? query : queryOrganization;
         };
         return ParserUtils.withOrigin(ctx, f);
     }
 
+    private LogicalPlan withQueryOrganization(QueryOrganizationContext ctx, 
LogicalPlan children) {
+        List<SortItems> sortItems = visitQueryOrganization(ctx);
+        return sortItems == null ? null : new LogicalUnaryPlan(new 
LogicalSort(sortItems), children);

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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to