NGA-TRAN commented on issue #18594:
URL: https://github.com/apache/datafusion/issues/18594#issuecomment-3512889922

   This is the keys of the problem:
   
   > The display logic can be found in 
datafustion/physical-plan/src/repartition/mod.rs:611-650. The preserve_order 
field is only displayed when the flag is true. It does not show that order is 
preserved when input_partitions=1 which is misleading.
   
   ### We need to think about the right display to avoid confusion:
   
   > Order within repartitions is dependent on two things, the preserve_order 
flag and input_partition_count
   > 
   > - If the preserve order flag is true then no matter the number of input 
partitions the order will be preserved
   > - If the preserve order flag is false then order is only preserved if 
there is a single input partition
   > - Otherwise ordering is not preserved
   
   
   Good display that includes `preserve_order=true` and `sort_exprs=c@2 ASC` 
for the case that preserve order flag is true
   
   ` RepartitionExec: partitioning=Hash([c@2], 10), input_partitions=10, 
preserve_order=true, sort_exprs=c@2 ASC`
   
   Missing `preserve_order` and the `sort_exprs`. The issue of this one is the 
flag preserve_order=false but we still have the order preserved 🙂 . We might 
need to think of display to make clear of that
   
   `RepartitionExec: partitioning=Hash([a@1], 2), input_partitions=1`
   
     
   


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