englefly commented on code in PR #64849:
URL: https://github.com/apache/doris/pull/64849#discussion_r3628632207


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java:
##########
@@ -675,8 +675,12 @@ public class Rewriter extends AbstractBatchJobExecutor {
                         cascadesContext -> 
cascadesContext.rewritePlanContainsTypes(LogicalAggregate.class)
                                 || 
cascadesContext.rewritePlanContainsTypes(LogicalJoin.class)
                                 || 
cascadesContext.rewritePlanContainsTypes(LogicalUnion.class),
-                        topDown(new EliminateGroupByKey()),
+                        // PushDownAggThroughJoinOnPkFk must run before 
EliminateGroupByKey,
+                        // because EliminateGroupByKey wraps FD-redundant 
group-by keys with
+                        // ANY_VALUE and rewrites ExprIds, which 
PushDownAggThroughJoinOnPkFk
+                        // cannot fully handle (especially for non-PK/FK 
primary table columns).
                         topDown(new PushDownAggThroughJoinOnPkFk()),
+                        custom(RuleType.ELIMINATE_GROUP_BY_KEY, 
EliminateGroupByKey::new),

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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to