From a10d8ab9082165f33723c68526f5030b7bea982c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Heres?= Date: Tue, 10 Dec 2024 09:44:17 +0100 Subject: [PATCH] Update datafusion/core/src/physical_optimizer/enforce_distribution.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Berkay Şahin <124376117+berkaysynnada@users.noreply.github.com> --- datafusion/core/src/physical_optimizer/enforce_distribution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/src/physical_optimizer/enforce_distribution.rs b/datafusion/core/src/physical_optimizer/enforce_distribution.rs index 570791af5950..670c03dcd643 100644 --- a/datafusion/core/src/physical_optimizer/enforce_distribution.rs +++ b/datafusion/core/src/physical_optimizer/enforce_distribution.rs @@ -837,7 +837,7 @@ fn add_roundrobin_on_top( ) -> Result { // Adding repartition is helpful: if input.plan.output_partitioning().partition_count() < n_target - || input.plan.children().is_empty() + || (input.plan.children().is_empty() && input.plan.output_partitioning().partition_count() > 1) { // When there is an existing ordering, we preserve ordering // during repartition. This will be un-done in the future