alamb opened a new issue, #5817: URL: https://github.com/apache/arrow-datafusion/issues/5817
### Is your feature request related to a problem or challenge? **Is your feature request related to a problem or challenge? Please describe what you are trying to do.** Some features / tools (like our initial implementation of FlightSQL metadata queries) will sometimes include predicates such as ```sql WHERE column LIKE '%' ``` This is for convenience (as sometimes the column needs an actual pattern match on it) Evaluating regular expressions is quite expensive and should be avoided whenever possible ### Describe the solution you'd like Add rewrite rules to rewrite rules for `LIKE`, `ILIKE` `NOT LIKE` and `NOT ILIKE` for these predicates `col LIKE '%'` --> `true` if col is not null `col ILIKE '%'` --> `true` if col is not null `col NOT LIKE '%'` --> `false` if col is not null `col NOT ILIKE '%'` --> `false` if col is not null Rewrite rules are https://github.com/apache/arrow-datafusion/blob/feff5dc/datafusion/optimizer/src/simplify_expressions.rs#L793 ### Describe alternatives you've considered _No response_ ### Additional context I think this is a good first issue because there is an existing pattern to follow -- 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]
