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


##########
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:
   The inner expressions in these expressions may be short-circuited.



-- 
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