Repartition input files according to the settings on this [`FileGroupPartitioner`]. If no repartitioning is needed or possible, return `None`.
(
&self,
file_groups: &[FileGroup],
)
| 184 | /// |
| 185 | /// If no repartitioning is needed or possible, return `None`. |
| 186 | pub fn repartition_file_groups( |
| 187 | &self, |
| 188 | file_groups: &[FileGroup], |
| 189 | ) -> Option<Vec<FileGroup>> { |
| 190 | if file_groups.is_empty() { |
| 191 | return None; |
| 192 | } |
| 193 | |
| 194 | // special case when order must be preserved |
| 195 | if self.preserve_order_within_groups { |
| 196 | self.repartition_preserving_order(file_groups) |
| 197 | } else { |
| 198 | self.repartition_evenly_by_size(file_groups) |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | /// Evenly repartition files across partitions by size, ignoring any |
| 203 | /// existing grouping / ordering |