fmcmac opened a new issue, #27551:
URL: https://github.com/apache/datafusion/issues/27551

   ### Is your feature request related to a problem or challenge?
   
   sqlparser parses `expr [NOT] RLIKE pattern` and `expr [NOT] REGEXP pattern`, 
but DataFusion refuses both at planning:
   
   ```sql
   SELECT 'abc' RLIKE '^a';
   -- This feature is not implemented: Unsupported ast node in sqltorel: RLike 
{ negated: false, .. }
   ```
   
   Expected: `true`, the same as `regexp_like('abc', '^a')`, which works today.
   
   Queries written for Spark, Hive or MySQL use these operators directly, so 
they fail when run on DataFusion. We hit this with user queries in our own 
deployment.
   
   ### Describe the solution you'd like
   
   Plan `expr [NOT] RLIKE|REGEXP pattern` as `[NOT] regexp_like(expr, 
pattern)`, resolved through the function registry like an explicit call.
   
   It matches regexp_like: case-sensitive, under every dialect, as DataFusion's 
LIKE does. Spark and Hive behave the same; MySQL's REGEXP is case-insensitive 
under its default collations so MySQL users would see a difference.
   
   ### Describe alternatives you've considered
   
   Plan as `Operator::RegexMatch` (`~`). The unparser then renders `~` for 
every dialect, which Spark, Hive and MySQL do not accept. A function call can 
be renamed per dialect.
   
   ### Additional context
   
   #26467 implemented this and was closed on 29 Oct because I did not answer 
the review in time. That was my miss. I have @Omega359's review points 
addressed on a local branch, and can reopen it if this direction is wanted.
   
   ### Willingness to contribute
   
   Glad to contribute.
   


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