yyy1000 commented on issue #6899:
URL: 
https://github.com/apache/arrow-datafusion/issues/6899#issuecomment-1924036014

   I'd like to help this. (Looks not so difficult I think)
   Currently, my thoughts are:
   1. Implement a `PartitionedSort ` PhysicalPlan, which could sort in each 
partition, and merge them after each partition is sorted.
   2. When there's a `PARTITION BY`, I think it can be known by 
`input.output_partitioning().partition_count()`, match the LogicalPlan::Sort to 
`PartitionedSort` in 
https://github.com/apache/arrow-datafusion/blob/a6ef1bec480872f15f83628a7fb8c9bb2722cd49/datafusion/core/src/physical_planner.rs#L938-L950
   
   A question is whether the `fetch` in `LogicalPlan` is what we need in 
`PartitionedSort`, (seems not), I could try it. 


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