Apache DataFusion SQL Query Engine
replace private is_volatile_expression_tree with equivalent public is_volatile (#20056)
Adrian Garcia Badaraccoed0a060185c8
diff --git a/datafusion/physical-optimizer/src/projection_pushdown.rs b/datafusion/physical-optimizer/src/projection_pushdown.rsindex 281d61aecf..99922ba075 100644--- a/datafusion/physical-optimizer/src/projection_pushdown.rs+++ b/datafusion/physical-optimizer/src/projection_pushdown.rs@@ -32,7 +32,7 @@ use datafusion_common::tree_node::{};use datafusion_common::{JoinSide, JoinType, Result};use datafusion_physical_expr::expressions::Column;-use datafusion_physical_expr_common::physical_expr::PhysicalExpr;+use datafusion_physical_expr_common::physical_expr::{PhysicalExpr, is_volatile};use datafusion_physical_plan::ExecutionPlan;use datafusion_physical_plan::joins::NestedLoopJoinExec;use datafusion_physical_plan::joins::utils::{ColumnIndex, JoinFilter};@@ -349,8 +349,7 @@ impl<'a> JoinFilterRewriter<'a> {// Recurse if there is a dependency to both sides or if the entire expression is volatile.let depends_on_other_side =self.depends_on_join_side(&expr, self.join_side.negate())?;- let is_volatile = is_volatile_expression_tree(expr.as_ref());- if depends_on_other_side || is_volatile {+ if depends_on_other_side || is_volatile(&expr) {return expr.map_children(|expr| self.rewrite(expr));}@@ -431,18 +430,6 @@ impl<'a> JoinFilterRewriter<'a> {}}-fn is_volatile_expression_tree(expr: &dyn PhysicalExpr) -> bool {- if expr.is_volatile_node() {- return true;- }-- expr.children()- .iter()- .map(|expr| is_volatile_expression_tree(expr.as_ref()))- .reduce(|lhs, rhs| lhs || rhs)- .unwrap_or(false)-}-#[cfg(test)]mod test {use super::*;