YjyJeff opened a new issue, #7834:
URL: https://github.com/apache/arrow-datafusion/issues/7834

   ### Describe the bug
   
   The 
[comment](https://github.com/apache/arrow-datafusion/blob/main/datafusion/core/src/physical_optimizer/enforce_distribution.rs#L1047)
 in `EnforeDistribution` said:
   
   > Hashing benefits from partitioning, add a round-robin repartition before it
   
   It sounds pretty odd. In a specific example:
   ```
   before: 
   
   AggregateExec: mode=FinalPartitioned, gby=[ip@0 as ip], 
aggr=[COUNT(Int64(1))]
     AggregateExec: mode=Partial, gby=[ip@0 as ip], aggr=[COUNT(Int64(1))]
   
   after:
   
   AggregateExec: mode=FinalPartitioned, gby=[ip@0 as ip], 
aggr=[COUNT(Int64(1))]
     RepartitionExec: partitioning=Hash([ip@0], 2), input_partitions=2
        RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
          AggregateExec: mode=Partial, gby=[ip@0 as ip], aggr=[COUNT(Int64(1))]
   ```
   
   Can anyone explain why the `RepartitionExec: 
partitioning=RoundRobinBatch(2), input_partitions=1` could accelerate the plan? 
In my view, removing this `RepartitionExec` will be faster 😂
   
   Thanks in advance.
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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