Implementation of [`ExecutionPlan::repartitioned`] which relies upon the inner [`DataSource::repartitioned`]. If the data source does not support changing its partitioning, returns `Ok(None)` (the default). Refer to [`ExecutionPlan::repartitioned`] for more details.
(
&self,
target_partitions: usize,
config: &ConfigOptions,
)
| 363 | /// If the data source does not support changing its partitioning, returns `Ok(None)` (the default). Refer |
| 364 | /// to [`ExecutionPlan::repartitioned`] for more details. |
| 365 | fn repartitioned( |
| 366 | &self, |
| 367 | target_partitions: usize, |
| 368 | config: &ConfigOptions, |
| 369 | ) -> Result<Option<Arc<dyn ExecutionPlan>>> { |
| 370 | let data_source = self.data_source.repartitioned( |
| 371 | target_partitions, |
| 372 | config.optimizer.repartition_file_min_size, |
| 373 | self.properties().eq_properties.output_ordering(), |
| 374 | )?; |
| 375 | |
| 376 | Ok(data_source.map(|source| { |
| 377 | let output_partitioning = source.output_partitioning(); |
| 378 | let plan = self |
| 379 | .clone() |
| 380 | .with_data_source(source) |
| 381 | // Changing source partitioning may invalidate output partitioning. Update it also |
| 382 | .with_partitioning(output_partitioning); |
| 383 | Arc::new(plan) as _ |
| 384 | })) |
| 385 | } |
| 386 | |
| 387 | fn execute( |
| 388 | &self, |
nothing calls this directly
no test coverage detected