Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions datafusion/physical-expr/src/equivalence/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch, thats the typo!

&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
Expand Down
Loading