chenhao7253886 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_r292820315
##########
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()) {
+ root = createRepeatNodePlan(selectStmt, analyzer, root);
+ }
+
+ root = createAggregationPlan(selectStmt, analyzer, root);
+ }
+
+ return root;
+ }
+
+ private PlanNode createRepeatNodePlan(SelectStmt selectStmt, Analyzer
analyzer,
+ PlanNode root) throws UserException
{
+ GroupByClause groupByClause = selectStmt.getGroupByClause();
+ Preconditions.checkState(groupByClause != null &&
groupByClause.isGroupByExtension());
+
Review comment:
This check has been add in what call createRepeatNodePlan , it is useless.
----------------------------------------------------------------
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]