Skip to content

Commit 3051cd4

Browse files
committed
Set across_partitions=true when both sides are constant
1 parent 8bc7fd2 commit 3051cd4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

datafusion/physical-expr/src/equivalence/properties.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,11 @@ fn calculate_union_binary(
18431843
.map(|rhs_const| {
18441844
let mut const_expr = ConstExpr::new(Arc::clone(lhs_const.expr()));
18451845

1846+
// If both sides are constant across partitions, set across_partitions=true
1847+
if lhs_const.across_partitions() && rhs_const.across_partitions() {
1848+
const_expr = const_expr.with_across_partitions(true);
1849+
}
1850+
18461851
// If both sides have matching constant values, preserve the value and set across_partitions=true
18471852
if let (Some(lhs_val), Some(rhs_val)) =
18481853
(lhs_const.value(), rhs_const.value())

0 commit comments

Comments
 (0)