Jefffrey commented on code in PR #18948:
URL: https://github.com/apache/datafusion/pull/18948#discussion_r2566512194


##########
datafusion/datasource/src/file_groups.rs:
##########
@@ -218,14 +209,21 @@ impl FileGroupPartitioner {
 
         let total_size = flattened_files
             .iter()
-            .map(|f| f.object_meta.size as i64)
+            .map(|f| {
+                if let Some(range) = &f.range {
+                    range.end - range.start
+                } else {
+                    f.object_meta.size as i64
+                }
+            })
             .sum::<i64>();
         if total_size < (repartition_file_min_size as i64) || total_size == 0 {
             return None;
         }
 
         let target_partition_size =
             (total_size as u64).div_ceil(target_partitions as u64);
+        println!("total_size={total_size}, 
target_partitions={target_partitions}, 
target_partition_size={target_partition_size}");

Review Comment:
   Debugging print?



##########
datafusion/datasource/src/file_groups.rs:
##########
@@ -189,15 +189,6 @@ impl FileGroupPartitioner {
             return None;
         }
 
-        // Perform redistribution only in case all files should be read from 
beginning to end
-        let has_ranges = file_groups
-            .iter()
-            .flat_map(FileGroup::iter)
-            .any(|f| f.range.is_some());
-        if has_ranges {
-            return None;
-        }
-
         //  special case when order must be preserved
         if self.preserve_order_within_groups {
             self.repartition_preserving_order(file_groups)

Review Comment:
   Do we need to change `repartition_preserving_order` as well?



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