Skip to content

Commit 57a3c63

Browse files
committed
perf(cube): Make EquivalenceProperties of CoalescePartitionsExec special-case single-partition inputs
1 parent 4bd7aca commit 57a3c63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

datafusion/physical-plan/src/coalesce_partitions.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ impl CoalescePartitionsExec {
6464
fn compute_properties(input: &Arc<dyn ExecutionPlan>) -> PlanProperties {
6565
// Coalescing partitions loses existing orderings:
6666
let mut eq_properties = input.equivalence_properties().clone();
67-
eq_properties.clear_orderings();
68-
eq_properties.clear_per_partition_constants();
67+
if input.output_partitioning().partition_count() > 1 {
68+
eq_properties.clear_orderings();
69+
eq_properties.clear_per_partition_constants();
70+
}
6971
PlanProperties::new(
7072
eq_properties, // Equivalence Properties
7173
Partitioning::UnknownPartitioning(1), // Output Partitioning

0 commit comments

Comments
 (0)