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

terran2010 commented on CALCITE-7428:
-------------------------------------

Yes, REGEXP is an infix operator in Hive, but there is already a REGEXP 
function in Cacltie. If another REGEXP operator is added, the original SQL 
parsing will report an error: Incorrect syntax near the keyword 'REGEXP'. 
Therefore, my idea is to convert the REGEXP function into a REGEXP operator 
based on the Hive dialect, and we can discuss in detail how to improve the 
current scenario [~jhyde] 

> Add regexp function (enabled in Hive library)
> ---------------------------------------------
>
>                 Key: CALCITE-7428
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7428
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: terran2010
>            Priority: Major
>              Labels: pull-request-available
>
> The SQL:
>  
> {code:java}
> select brand_name from product where brand_name REGEXP('[a-zA-Z]')   {code}
> Run error:
> {code:java}
> org.apache.calcite.sql.parser.SqlParseException: Encountered "REGEXP" at line 
> 2, column 35.
> Was expecting one of:
>     <EOF> 
>     "EXCEPT" ...
>     "FETCH" ...
>     "GROUP" ...
>     "HAVING" ...
>     "INTERSECT" ...
>     "LIMIT" ...
>     "OFFSET" ... {code}
> we can refer hive document about Position: 
> https://hive.apache.org/docs/latest/language/hive-operators/
>  



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

Reply via email to