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

Danny Chen updated CALCITE-3973:
--------------------------------
    Summary: Hints should not unparse as enclosed in parentheses  (was: Writing 
SQL hints to a string results in SQL that cannot be parsed )

> Hints should not unparse as enclosed in parentheses
> ---------------------------------------------------
>
>                 Key: CALCITE-3973
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3973
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.22.0
>            Reporter: Alex Baden
>            Priority: Minor
>             Fix For: 1.23.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When using the new SQL hints feature:
>  
> {code:java}
> select /*+ cpu */ x from test limit 2;
> {code}
> If one calls to SqlString() on the node:
>  
>  
> {code:java}
> node.toSqlString(CalciteSqlDialect.DEFAULT).toString()
> {code}
>  
> We get:
>  
> {code:java}
> 'SELECT /*+ ("cpu") */ "x" FROM "test" FETCH NEXT 2 ROWS ONLY'
> {code}
> {{which is not valid SQL for a hint. It looks like the precedence options 
> need to be modified when writing out the hint in SqlSelectOperator.unparse}}
>  
> We do some rewriting of the sql statement and then re-parse it, so this is 
> preventing us from using hints. I am happy to submit a patch if I am headed 
> in the right direction with the description above. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to