Skip to content

Commit bd0b56f

Browse files
authored
chore: deprecate function with typo in name (is_expr_constant_accross_partitions) (#14252)
* deprecate function with typo in name (is_expr_constant_across_partitions) * fmt
1 parent 72c0df4 commit bd0b56f

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ impl EquivalenceProperties {
10461046
if self.is_expr_constant(source)
10471047
&& !const_exprs_contains(&projected_constants, target)
10481048
{
1049-
if self.is_expr_constant_accross_partitions(source) {
1049+
if self.is_expr_constant_across_partitions(source) {
10501050
projected_constants.push(
10511051
ConstExpr::from(target)
10521052
.with_across_partitions(self.get_expr_constant_value(source)),
@@ -1221,10 +1221,33 @@ impl EquivalenceProperties {
12211221
/// # Returns
12221222
///
12231223
/// Returns `true` if the expression is constant across all partitions according
1224-
/// to equivalence group, `false` otherwise.
1224+
/// to equivalence group, `false` otherwise
1225+
#[deprecated(
1226+
since = "45.0.0",
1227+
note = "Use [`is_expr_constant_across_partitions`] instead"
1228+
)]
12251229
pub fn is_expr_constant_accross_partitions(
12261230
&self,
12271231
expr: &Arc<dyn PhysicalExpr>,
1232+
) -> bool {
1233+
self.is_expr_constant_across_partitions(expr)
1234+
}
1235+
1236+
/// This function determines whether the provided expression is constant
1237+
/// across partitions based on the known constants.
1238+
///
1239+
/// # Parameters
1240+
///
1241+
/// - `expr`: A reference to a `Arc<dyn PhysicalExpr>` representing the
1242+
/// expression to be checked.
1243+
///
1244+
/// # Returns
1245+
///
1246+
/// Returns `true` if the expression is constant across all partitions according
1247+
/// to equivalence group, `false` otherwise.
1248+
pub fn is_expr_constant_across_partitions(
1249+
&self,
1250+
expr: &Arc<dyn PhysicalExpr>,
12281251
) -> bool {
12291252
// As an example, assume that we know columns `a` and `b` are constant.
12301253
// Then, `a`, `b` and `a + b` will all return `true` whereas `c` will

0 commit comments

Comments
 (0)