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