haohuaijin commented on code in PR #8833:
URL: https://github.com/apache/arrow-datafusion/pull/8833#discussion_r1452268076


##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -614,7 +613,12 @@ impl ExprIdentifierVisitor<'_> {
 impl TreeNodeVisitor for ExprIdentifierVisitor<'_> {
     type N = Expr;
 
-    fn pre_visit(&mut self, _expr: &Expr) -> Result<VisitRecursion> {
+    fn pre_visit(&mut self, expr: &Expr) -> Result<VisitRecursion> {
+        // related to https://github.com/apache/arrow-datafusion/issues/8814
+        // If the expr contain volatile expression or is a case expression, 
skip it.
+        if matches!(expr, Expr::Case(..)) || is_volatile_expression(expr)? {

Review Comment:
   track in #8874



##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -739,7 +740,9 @@ impl OptimizerRule for PushDownFilter {
 
                             (field.qualified_name(), expr)
                         })
-                        .partition(|(_, value)| is_volatile_expression(value));
+                        .partition(|(_, value)| {
+                            is_volatile_expression(value).unwrap_or(true)

Review Comment:
   If we don't know whether the scalar function is volatile, default set it to 
a volatile function.
    



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to