@@ -32,7 +32,7 @@ use datafusion_common::tree_node::{
3232} ;
3333use datafusion_common:: { JoinSide , JoinType , Result } ;
3434use datafusion_physical_expr:: expressions:: Column ;
35- use datafusion_physical_expr_common:: physical_expr:: PhysicalExpr ;
35+ use datafusion_physical_expr_common:: physical_expr:: { PhysicalExpr , is_volatile } ;
3636use datafusion_physical_plan:: ExecutionPlan ;
3737use datafusion_physical_plan:: joins:: NestedLoopJoinExec ;
3838use datafusion_physical_plan:: joins:: utils:: { ColumnIndex , JoinFilter } ;
@@ -349,8 +349,7 @@ impl<'a> JoinFilterRewriter<'a> {
349349 // Recurse if there is a dependency to both sides or if the entire expression is volatile.
350350 let depends_on_other_side =
351351 self . depends_on_join_side ( & expr, self . join_side . negate ( ) ) ?;
352- let is_volatile = is_volatile_expression_tree ( expr. as_ref ( ) ) ;
353- if depends_on_other_side || is_volatile {
352+ if depends_on_other_side || is_volatile ( & expr) {
354353 return expr. map_children ( |expr| self . rewrite ( expr) ) ;
355354 }
356355
@@ -431,18 +430,6 @@ impl<'a> JoinFilterRewriter<'a> {
431430 }
432431}
433432
434- fn is_volatile_expression_tree ( expr : & dyn PhysicalExpr ) -> bool {
435- if expr. is_volatile_node ( ) {
436- return true ;
437- }
438-
439- expr. children ( )
440- . iter ( )
441- . map ( |expr| is_volatile_expression_tree ( expr. as_ref ( ) ) )
442- . reduce ( |lhs, rhs| lhs || rhs)
443- . unwrap_or ( false )
444- }
445-
446433#[ cfg( test) ]
447434mod test {
448435 use super :: * ;
0 commit comments