jonmmease opened a new pull request, #4878:
URL: https://github.com/apache/arrow-datafusion/pull/4878

   # Which issue does this PR close?
   
   Closes #4873.
   
   # Rationale for this change
   See #4873 for a failing example and some preliminary investigation.
   
   The issue is in the EnforceDistribution physical optimizer (the query from 
the issue works without it).  After looking at this for a while, I think I see 
what's going on.  Normally, the column expressions for a group by have indices 
that correspond to the schema of the input operation. But for the case of a 
partial aggregation, these indices need to be updated to correspond to the 
schema of the partial aggregation instead of the input.
   
   This make sense to me, and it fixes the query, but this is the first time 
I've looked at the Physical optimizer so someone who's more familiar with that 
side of things should definitely take a look before merging this.
   
   # Are these changes tested?
   
   I added a test case based on the query reported in the issue.


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

Reply via email to