adriangb commented on code in PR #13061:
URL: https://github.com/apache/datafusion/pull/13061#discussion_r1827802480


##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -3632,6 +3638,16 @@ mod tests {
 
         let expr = not_ilike(null, "%");
         assert_eq!(simplify(expr), lit_bool_null());
+
+        // test cases that get converted to equality
+        let expr = like(col("c1"), "a");
+        assert_eq!(simplify(expr), col("c1").eq(lit("a")));
+        let expr = not_like(col("c1"), "a");
+        assert_eq!(simplify(expr), col("c1").not_eq(lit("a")));
+        let expr = like(col("c1"), "a_");
+        assert_eq!(simplify(expr), col("c1").like(lit("a_")));
+        let expr = not_like(col("c1"), "a_");
+        assert_eq!(simplify(expr), col("c1").not_like(lit("a_")));

Review Comment:
   Added in 6c847fa6a



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