You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/07/27 06:48:04 UTC

[jira] [Closed] (CALCITE-817) Extension column cannot have name "row"

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

Julian Hyde closed CALCITE-817.
-------------------------------
    Resolution: Invalid

ROW (and ROWS) is a reserved key-word from SQL:99 onward. Example: {code}SELECT *
FROM emp
ORDER BY empno OFFSET 1 ROW FETCH NEXT 5 ROWS{code}

You can use a reserved keyword as an identifier, but you must quote it (using double quotes in the default lexical scheme): {code}SELECT deptno AS "ROW" FROM emp{code}

> Extension column cannot have name "row"
> ---------------------------------------
>
>                 Key: CALCITE-817
>                 URL: https://issues.apache.org/jira/browse/CALCITE-817
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.4.0-incubating
>            Reporter: Jesse Yates
>            Assignee: Julian Hyde
>
> A weird corner case, but it seems like you cannot have an extension column with the name "row". Blows up with:
> {quote}
> Caused by: java.sql.SQLException: error while executing SQL "select stream * from orders EXTEND (row varchar)": parse failed: Encountered "row" at line 1, column 37.
> Was expecting one of:
>     <IDENTIFIER> ...
>     <QUOTED_IDENTIFIER> ...
>     <BACK_QUOTED_IDENTIFIER> ...
>     <BRACKET_QUOTED_IDENTIFIER> ...
>     <UNICODE_QUOTED_IDENTIFIER> ...
>     
> 	at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
> 	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:112)
> 	at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:130)
> 	at org.apache.calcite.test.CalciteAssert.assertQuery(CalciteAssert.java:450)
> 	... 29 more
> Caused by: java.lang.RuntimeException: parse failed: Encountered "row" at line 1, column 37.
> Was expecting one of:
>     <IDENTIFIER> ...
>     <QUOTED_IDENTIFIER> ...
>     <BACK_QUOTED_IDENTIFIER> ...
>     <BRACKET_QUOTED_IDENTIFIER> ...
>     <UNICODE_QUOTED_IDENTIFIER> ...
>     
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:647)
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:570)
> 	at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:539)
> 	at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:173)
> 	at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:561)
> 	at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:477)
> 	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:110)
> 	... 31 more
> {quote}
> Any other name seems to work (but not sure where to check for this in the code).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)