From 6123a8666a45ab2d69933863524384c438f0e208 Mon Sep 17 00:00:00 2001 From: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com> Date: Wed, 29 Oct 2025 21:33:20 +0400 Subject: [PATCH] fix: Repartition joins when `target_partitions = 1` when required Signed-off-by: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com> --- datafusion/core/src/physical_plan/planner.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datafusion/core/src/physical_plan/planner.rs b/datafusion/core/src/physical_plan/planner.rs index 98420a672404..6f0bfc4cee48 100644 --- a/datafusion/core/src/physical_plan/planner.rs +++ b/datafusion/core/src/physical_plan/planner.rs @@ -923,7 +923,8 @@ impl DefaultPhysicalPlanner { }) .collect::>()?; - if session_state.config.target_partitions > 1 + if (session_state.config.target_partitions > 1 + || physical_right.output_partitioning().partition_count() > 1) && session_state.config.repartition_joins { let (left_expr, right_expr) = join_on