imay commented on a change in pull request #1292: Support Grouping Sets, Rollup 
and Cube to extend group by statement
URL: https://github.com/apache/incubator-doris/pull/1292#discussion_r294033821
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
 ##########
 @@ -685,7 +656,59 @@ private PlanNode createSelectPlan(SelectStmt selectStmt, 
Analyzer analyzer, long
         }
 
         // add aggregation, if required
-        if (aggInfo != null) root = createAggregationPlan(selectStmt, 
analyzer, root);
+        if (aggInfo != null) {
+            // introduce repeatNode for group by extension
+            GroupByClause groupByClause = selectStmt.getGroupByClause();
+            if (groupByClause != null && groupByClause.isGroupByExtension()) {
 
 Review comment:
   I think that this kind of implementation don't work in some case.
   If RepeatNode don't have itself's Tuple, you can set the group by item to 
null. 
   For example query like `group by ROLLUP(a, ifnull(b, "a"))`, you only set b 
is null, but func(b) can be not null. which would make a wrong result

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to