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

Alex Baden commented on CALCITE-3973:
-------------------------------------

Thanks [~danny0405], I've put up a PR: 
[https://github.com/apache/calcite/pull/1961]

> 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
>          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