alamb commented on code in PR #17450: URL: https://github.com/apache/datafusion/pull/17450#discussion_r2349463864
########## datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs: ########## @@ -1399,6 +1399,18 @@ impl<S: SimplifyInfo> TreeNodeRewriter for Simplifier<'_, S> { // Rules for Case // + // CASE WHEN true THEN A ... END --> A + Expr::Case(Case { + expr: None, + mut when_then_expr, + else_expr: _, + }) if !when_then_expr.is_empty() Review Comment: Reading this code again, it seems like we could remove all WHEN THEN clauses with `true`, not just the first However, this is an improvement over what is on main so it would be a good follow on pR -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org