petern48 commented on code in PR #20702:
URL: https://github.com/apache/datafusion/pull/20702#discussion_r2920967522


##########
datafusion/optimizer/src/simplify_expressions/regex.rs:
##########
@@ -68,12 +68,11 @@ pub fn simplify_regex_expr(
     // Handle the special case for ".*" pattern
     if pattern == ANY_CHAR_REGEX_PATTERN {
         let new_expr = if mode.not {
-            // not empty
-            let empty_lit = Box::new(string_scalar.to_expr(""));
+            let null_bool = lit(ScalarValue::Boolean(None));
             Expr::BinaryExpr(BinaryExpr {
-                left,
-                op: Operator::Eq,
-                right: empty_lit,
+                left: Box::new(left.is_not_null()),

Review Comment:
   Yes, definitely agree!



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