mustafasrepo commented on code in PR #7832:
URL: https://github.com/apache/arrow-datafusion/pull/7832#discussion_r1360666741


##########
datafusion/core/src/physical_optimizer/enforce_distribution.rs:
##########
@@ -1289,9 +1287,16 @@ fn ensure_distribution(
             maintains,
             child_idx,
         )| {
+            // Don't need to apply when the returned row count is not greater 
than 1:
+            let stats = child.statistics();
+            let repartition_beneficial_stats = if stats.is_exact {
+                stats.num_rows.map(|num_rows| num_rows > 1).unwrap_or(true)

Review Comment:
   @Dandandan  I updated check as you suggested. Some of the existing tests 
changes with this change. I think, changes are for the better. However, I would 
appreciate If you can double check them.



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