feiniaofeiafei commented on code in PR #42199:
URL: https://github.com/apache/doris/pull/42199#discussion_r1963465068


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpPredicates.java:
##########
@@ -273,24 +284,31 @@ public ImmutableSet<Expression> 
visitLogicalProject(LogicalProject<? extends Pla
     public ImmutableSet<Expression> visitLogicalAggregate(LogicalAggregate<? 
extends Plan> aggregate, Void context) {
         return cacheOrElse(aggregate, () -> {
             ImmutableSet<Expression> childPredicates = 
aggregate.child().accept(this, context);
-            // TODO
             List<NamedExpression> outputExpressions = 
aggregate.getOutputExpressions();
-
-            Map<Expression, Slot> expressionSlotMap
-                    = 
Maps.newLinkedHashMapWithExpectedSize(outputExpressions.size());
+            Map<Expression, List<Slot>> expressionSlotMap
+                    = 
Maps.newHashMapWithExpectedSize(outputExpressions.size());
             for (NamedExpression output : outputExpressions) {
-                if (hasAgg(output)) {
-                    expressionSlotMap.putIfAbsent(
-                            output instanceof Alias ? output.child(0) : 
output, output.toSlot()
-                    );
+                if (output instanceof Alias && 
supportPullUpAgg(output.child(0))) {
+                    expressionSlotMap.computeIfAbsent(output.child(0).child(0),
+                            k -> new ArrayList<>()).add(output.toSlot());
+                }

Review Comment:
   these function only has one child:min,max,avg



-- 
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