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

Rui Li commented on CALCITE-3038:
---------------------------------

[~danny0405], a simple test case in SqlParserTest will reproduce the issue:
{code}
  @Test public void testDescribe() {
    check("describe source", "DESCRIBE TABLE `SOURCE`");
  }
{code}
And stack trace is:
{noformat}
[ERROR] testDescribe(org.apache.calcite.sql.parser.SqlParserTest)  Time 
elapsed: 0.347 s  <<< ERROR!
java.lang.RuntimeException: Error while parsing SQL: describe source
        at 
org.apache.calcite.sql.parser.SqlParserTest.check(SqlParserTest.java:592)
        at 
org.apache.calcite.sql.parser.SqlParserTest.testDescribe(SqlParserTest.java:3547)
Caused by: org.apache.calcite.sql.parser.SqlParseException: Non-query 
expression encountered in illegal context
        at 
org.apache.calcite.sql.parser.SqlParserTest.check(SqlParserTest.java:592)
        at 
org.apache.calcite.sql.parser.SqlParserTest.testDescribe(SqlParserTest.java:3547)
Caused by: org.apache.calcite.runtime.CalciteException: Non-query expression 
encountered in illegal context
        at 
org.apache.calcite.sql.parser.SqlParserTest.check(SqlParserTest.java:592)
        at 
org.apache.calcite.sql.parser.SqlParserTest.testDescribe(SqlParserTest.java:3547)
{noformat}

> DESCRIBE throws exception when table name is non-reserved keyword
> -----------------------------------------------------------------
>
>                 Key: CALCITE-3038
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3038
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Rui Li
>            Priority: Major
>
> For example, suppose I have a table named {{source}}. {{DESCRIBE source}} 
> throws exception:
> {noformat}
> CalciteException: Non-query expression encountered in illegal context
> {noformat}
> Not sure if this behavior is intended. But if a user is allowed to create a 
> table named {{source}} w/o quoting it, it seems strange to require quoting 
> when describe the table.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to