AdamGS commented on code in PR #20111:
URL: https://github.com/apache/datafusion/pull/20111#discussion_r2755761518


##########
datafusion/physical-expr/src/simplifier/mod.rs:
##########
@@ -58,11 +67,11 @@ impl<'a> PhysicalExprSimplifier<'a> {
 
                 // Apply NOT expression simplification first, then unwrap cast 
optimization,
                 // then constant expression evaluation
-                let rewritten = simplify_not_expr(&node, schema)?
+                let rewritten = simplify_not_expr(node, schema)?
+                    .transform_data(|node| unwrap_cast_in_comparison(node, 
schema))?
                     .transform_data(|node| {
-                        unwrap_cast::unwrap_cast_in_comparison(node, schema)
-                    })?
-                    .transform_data(|node| 
const_evaluator::simplify_const_expr(&node))?;
+                        simplify_const_expr_with_dummy(node, &batch)

Review Comment:
   I agree, I think we can find the subtrees that do and then just skip the 
others, thinking through this now but it might have to wait for tomorrow



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to