alamb commented on code in PR #27827:
URL: https://github.com/apache/datafusion/pull/27827#discussion_r4775086265


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -2261,10 +2269,16 @@ impl ExecutionPlan for AggregateExec {
                 ..Self::clone(&*self)
             })),
             ChildrenPropertiesMode::Recompute => {
+                let aggr_expr = match self.mode.input_mode() {
+                    AggregateInputMode::Partial => {
+                        match_state_direction(self.aggr_expr(), &children[0])

Review Comment:
   this feels like the wrong place to be fixing this 
   
   It seems like the optimizer rule that swapped the join around should know 
about this
   
   It seems like it will be pretty brittle to assume nothing is between the two 
aggregate execs (e.g. if datafusion distributed adds a repartition or 
something, then this check won't fire)



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