[ 
https://issues.apache.org/jira/browse/CALCITE-7428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

terran2010 updated CALCITE-7428:
--------------------------------
    Description: 
When execute SQL:
{code:java}
select brand_name from product where brand_name REGEXP '[a-zA-Z]'   {code}
now will 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}
in calcite function Libs,we can find 
"REGEXP(value, regexp)" function,only support spark now,
Can we try to
{code:java}
select brand_name from product where REGEXP(brand_name,'[a-zA-Z]'){code}
convert to
{code:java}
select brand_name from product where brand_name REGEXP '[a-zA-Z]' {code}
when set to Hive dialect

we can refer hive document about Position: 
[https://hive.apache.org/docs/latest/language/hive-operators/]

 

  was:
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/

 


> Support regexp function change regexp operator for 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
>
> When execute SQL:
> {code:java}
> select brand_name from product where brand_name REGEXP '[a-zA-Z]'   {code}
> now will 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}
> in calcite function Libs,we can find 
> "REGEXP(value, regexp)" function,only support spark now,
> Can we try to
> {code:java}
> select brand_name from product where REGEXP(brand_name,'[a-zA-Z]'){code}
> convert to
> {code:java}
> select brand_name from product where brand_name REGEXP '[a-zA-Z]' {code}
> when set to Hive dialect
> 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