[jira] [Updated] (CALCITE-3973) Writing SQL hints to a string results in SQL that cannot be parsed

2020-05-06 Thread Julian Hyde (Jira)


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

Julian Hyde updated CALCITE-3973:
-
Affects Version/s: 1.22.0

> Writing SQL hints to a string results in SQL that cannot be parsed 
> ---
>
> 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)


[jira] [Updated] (CALCITE-3973) Writing SQL hints to a string results in SQL that cannot be parsed

2020-05-06 Thread Julian Hyde (Jira)


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

Julian Hyde updated CALCITE-3973:
-
Fix Version/s: 1.23.0

> Writing SQL hints to a string results in SQL that cannot be parsed 
> ---
>
> Key: CALCITE-3973
> URL: https://issues.apache.org/jira/browse/CALCITE-3973
> Project: Calcite
>  Issue Type: Bug
>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)