jackwener commented on code in PR #8833:
URL: https://github.com/apache/arrow-datafusion/pull/8833#discussion_r1452107106
##########
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:
I think this problem could exist in other function/expression like
`COALESCE` | `OR`
It can be tracked as a future ticket.
--
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]