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


##########
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:
   Makes sense, I will change accordingly.



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