alamb commented on code in PR #19073:
URL: https://github.com/apache/datafusion/pull/19073#discussion_r2620860213


##########
datafusion/core/src/physical_planner.rs:
##########
@@ -1599,6 +1603,25 @@ impl DefaultPhysicalPlanner {
     }
 }
 
+fn has_sufficient_rows_for_repartition(
+    input: &Arc<dyn ExecutionPlan>,
+    session_state: &SessionState,
+) -> Result<bool> {
+    // Get partition statistics, default to repartitioning if unavailable
+    let stats = match input.partition_statistics(None) {
+        Ok(s) => s,
+        Err(_) => return Ok(true),
+    };
+
+    if let Some(num_rows) = stats.num_rows.get_value().copied() {

Review Comment:
   I think there is already a config setting that would be appropriate for this 
setting (rather than using the batch size): 
https://datafusion.apache.org/user-guide/configs.html
   
   
   datafusion.optimizer.repartition_file_min_size |  
   -- | --
   
   
   
   What do you think?



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