Skip to content

Apache DataFusion SQL Query Engine

chore: deprecate function with typo in name (is_expr_constant_accross_partitions) (#14252)

Andy Grovebd0b56f86fb8
diff --git a/datafusion/physical-expr/src/equivalence/properties.rs b/datafusion/physical-expr/src/equivalence/properties.rs
index fed33315d7..a6417044a0 100755
--- a/datafusion/physical-expr/src/equivalence/properties.rs
+++ b/datafusion/physical-expr/src/equivalence/properties.rs
@@ -1046,7 +1046,7 @@ impl EquivalenceProperties {
if self.is_expr_constant(source)
&& !const_exprs_contains(&projected_constants, target)
{
- if self.is_expr_constant_accross_partitions(source) {
+ if self.is_expr_constant_across_partitions(source) {
projected_constants.push(
ConstExpr::from(target)
.with_across_partitions(self.get_expr_constant_value(source)),
@@ -1221,10 +1221,33 @@ impl EquivalenceProperties {
/// # Returns
///
/// Returns `true` if the expression is constant across all partitions according
- /// to equivalence group, `false` otherwise.
+ /// to equivalence group, `false` otherwise
+ #[deprecated(
+ since = "45.0.0",
+ note = "Use [`is_expr_constant_across_partitions`] instead"
+ )]
pub fn is_expr_constant_accross_partitions(
&self,
expr: &Arc<dyn PhysicalExpr>,
+ ) -> bool {
+ self.is_expr_constant_across_partitions(expr)
+ }
+
+ /// This function determines whether the provided expression is constant
+ /// across partitions based on the known constants.
+ ///
+ /// # Parameters
+ ///
+ /// - `expr`: A reference to a `Arc<dyn PhysicalExpr>` representing the
+ /// expression to be checked.
+ ///
+ /// # Returns
+ ///
+ /// Returns `true` if the expression is constant across all partitions according
+ /// to equivalence group, `false` otherwise.
+ pub fn is_expr_constant_across_partitions(
+ &self,
+ expr: &Arc<dyn PhysicalExpr>,
) -> bool {
// As an example, assume that we know columns `a` and `b` are constant.
// Then, `a`, `b` and `a + b` will all return `true` whereas `c` will