jonahgao commented on code in PR #7909:
URL: https://github.com/apache/arrow-datafusion/pull/7909#discussion_r1369776116


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -881,6 +910,42 @@ pub fn replace_cols_by_name(
     })
 }
 
+/// check whether the expression is volatile predicates
+pub fn is_volatile_expression(e: Expr) -> bool {
+    let mut is_volatile = false;
+    e.apply(&mut |expr| {
+        Ok(match expr {
+            Expr::ScalarFunction(f) if f.fun.volatility() == 
Volatility::Volatile => {
+                is_volatile = true;
+                VisitRecursion::Stop
+            }
+            _ => VisitRecursion::Continue,
+        })
+    })
+    .unwrap();
+    is_volatile
+}
+
+/// check whether the expression uses the columns in `check_map`.
+pub fn contain(e: Expr, check_map: &HashMap<String, Expr>) -> bool {

Review Comment:
   ```suggestion
   fn contain(e: &Expr, check_map: &HashMap<String, Expr>) -> bool {
   ```
   Similar to the function `is_volatile_expression`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to