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


##########
datafusion/optimizer/src/simplify_expressions/regex.rs:
##########
@@ -39,7 +39,7 @@ const ANY_CHAR_REGEX_PATTERN: &str = ".*";
 /// - partial anchored regex patterns (e.g. `^foo`) to `LIKE 'foo%'`
 /// - combinations (alternatives) of the above, will be concatenated with `OR` 
or `AND`
 /// - `EQ .*` to NotNull
-/// - `NE .*` means IS EMPTY
+/// - `NE .*` to false (.* matches non-empty and empty strings, and NULL !~ 
'.*' results in NULL so this can never be true)

Review Comment:
   ah thanks, i didn't realize this code applied to cases outside of filters. 
I've fixed it and updated the PR title and description.
   
   note: the optimizer would further rewrite the `CASE` expr into `IS NOT NULL 
AND NULL` when I ran the tests, so I rewrote it directly to that instead



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