NGA-TRAN commented on code in PR #18521:
URL: https://github.com/apache/datafusion/pull/18521#discussion_r2505687578


##########
datafusion/physical-optimizer/src/enforce_distribution.rs:
##########
@@ -1273,7 +1273,7 @@ pub fn ensure_distribution(
                     child = add_merge_on_top(child);
                 }
                 Distribution::HashPartitioned(exprs) => {
-                    if add_roundrobin {
+                    if add_roundrobin && !hash_necessary {

Review Comment:
   **To reviewers:** This is the fix. The rest is test update
   
   See 
[this](https://github.com/apache/datafusion/issues/18341#issuecomment-3505130845)
 for summary of the fix
   
   See[ 
this](https://github.com/apache/datafusion/issues/18341#issuecomment-3503238325)
 for full analysis in 2 pdf  doc
   



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