github-actions[bot] commented on code in PR #65024:
URL: https://github.com/apache/doris/pull/65024#discussion_r3787966530


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/ProjectAggregateExpressionsForCse.java:
##########
@@ -61,16 +60,9 @@ public Plan 
visitPhysicalHashAggregate(PhysicalHashAggregate<? extends Plan> agg
                 (PhysicalHashAggregate<? extends Plan>) super.visit(aggregate, 
ctx));
     }
 
-    @Override
-    public Plan visitPhysicalBucketedHashAggregate(
-            PhysicalBucketedHashAggregate<? extends Plan> aggregate, 
CascadesContext ctx) {
-        return projectAggregateCse(
-                (PhysicalBucketedHashAggregate<? extends Plan>) 
super.visit(aggregate, ctx));
-    }
-
     /**
-     * Shared CSE projection logic for both PhysicalHashAggregate and
-     * PhysicalBucketedHashAggregate. Extracts common sub-expressions from
+     * Shared CSE projection logic for PhysicalHashAggregate.

Review Comment:
   **[P2] Preserve aggregate-argument CSE through fusion**
   
   `PhysicalHashAggregate -> PhysicalDistribute` now hits the early return 
below, so the new bucketed one-phase shape no longer receives 
aggregate-argument CSE. For `SUM(a+b), MAX(a+b) GROUP BY g`, the old dedicated 
bucketed visitor produced `BucketedAgg(sum(x), max(x)) -> Project(a+b AS x)`, 
but the new tree remains `HashAgg(sum(a+b), max(a+b)) -> Distribute(hash(g))`; 
`visitBucketedFusion` then bypasses that distribute, and the two BE evaluators 
recompute `a+b` independently for every row. Please make this postprocessor 
handle the fusion pattern by placing/merging the CSE project beneath the 
existing distribute while preserving its distribution-key slots/ExprIds (or 
equivalent), and add a bucketed repeated-argument plan test.



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