msirek commented on issue #7781:
URL: 
https://github.com/apache/arrow-datafusion/issues/7781#issuecomment-1761949894

   Is the issue that the `RepartitionExec` doesn't know how to stop processing 
early to honor the `LocalLimitExec`?
   
https://github.com/apache/arrow-datafusion/blob/7b12666ec87ea741c3f5b56ddf1647f6d794f9e3/datafusion/physical-plan/src/repartition/mod.rs#L537-L544
   
   Maybe in cases where the partial group-by is the same as the outer group-by 
and there is no aggregate function applied requiring all rows in the group to 
be processed, it would be legal and useful to push `LocalLimitExec` below the 
`RepartitionExec`? That's assuming the partial group-by knows how to quit early 
when it's consumed by a `LocalLimitExec`.


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