Alex Baden created CALCITE-3973:
-----------------------------------

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


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