simonvandel commented on code in PR #19731:
URL: https://github.com/apache/datafusion/pull/19731#discussion_r2682313492
##########
datafusion/optimizer/src/simplify_expressions/utils.rs:
##########
@@ -290,6 +290,58 @@ pub fn is_lit(expr: &Expr) -> bool {
matches!(expr, Expr::Literal(_, _))
}
+/// Checks if `eq_expr` is `A = L1` and `ne_expr` is `A != L2` where L1 != L2.
+/// This pattern can be simplified to just `A = L1` since if A equals L1
+/// and L1 is different from L2, then A is automatically not equal to L2.
+pub fn is_eq_and_ne_with_different_literal(eq_expr: &Expr, ne_expr: &Expr) ->
bool {
Review Comment:
Thanks, done in
https://github.com/apache/datafusion/pull/19731/commits/ecb9a3d2f93238235db8d046034ebeeb474b4432
--
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]