[ 
https://issues.apache.org/jira/browse/CALCITE-7611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18090096#comment-18090096
 ] 

yibo wen commented on CALCITE-7611:
-----------------------------------

I would like to work on this if the community agrees with the API direction.

> Support MySQL-style infix REGEXP operator
> -----------------------------------------
>
>                 Key: CALCITE-7611
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7611
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.38.0
>            Reporter: yibo wen
>            Priority: Major
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Calcite supports regular-expression matching through RLIKE and the REGEXP 
> library function, but the parser does not currently accept MySQL-style infix 
> REGEXP expressions.
>   Example:
>   SELECT *
>   FROM emp
>   WHERE name REGEXP '^A.*';
>   Expected behavior:
>   In MySQL/Hive/Spark-compatible SQL libraries or conformances, Calcite 
> should parse and validate infix REGEXP expressions similarly to RLIKE.
>   Related syntax:
>   NOT REGEXP should also be supported, for example:
>   SELECT *
>   FROM emp
>   WHERE name NOT REGEXP '^A.*';
>   It should be equivalent to:
>   WHERE NOT (name REGEXP '^A.*')
>   Motivation:
>   MySQL supports expr REGEXP pattern. Hive and Spark users also commonly use 
> regular-expression predicates in infix form. Supporting this syntax would 
> improve dialect compatibility.
>   Possible implementation direction:
>   Add parser support for infix REGEXP and NOT REGEXP, map REGEXP to an 
> RLIKE-like operator, and add parser/validator tests for the supported 
> libraries.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to