From 4ad1851c85b84042c4684cba5f67327f53a6a287 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Thu, 5 Dec 2024 14:29:16 -0500 Subject: [PATCH] fix: Fix repartitioning regression (#1564) Old code was **adding** the new partitions to the existing ones instead of replacing them. --- vortex-datafusion/src/persistent/execution.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vortex-datafusion/src/persistent/execution.rs b/vortex-datafusion/src/persistent/execution.rs index b9debe4965..4530b6f26d 100644 --- a/vortex-datafusion/src/persistent/execution.rs +++ b/vortex-datafusion/src/persistent/execution.rs @@ -139,12 +139,11 @@ impl ExecutionPlan for VortexExec { let repartitioned_file_groups = repartition_by_count(file_groups, target_partitions); let mut new_plan = self.clone(); - let mut config = new_plan.file_scan_config; + let num_partitions = repartitioned_file_groups.len(); log::debug!("VortexExec repartitioned to {num_partitions} partitions"); - config = config.with_file_groups(repartitioned_file_groups); - new_plan.file_scan_config = config; + new_plan.file_scan_config.file_groups = repartitioned_file_groups; new_plan.plan_properties.partitioning = Partitioning::UnknownPartitioning(num_partitions); Ok(Some(Arc::new(new_plan)))