Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-817

Extension column cannot have name "row"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.4.0-incubating
    • None
    • None
    • None

    Description

      A weird corner case, but it seems like you cannot have an extension column with the name "row". Blows up with:

      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

      Any other name seems to work (but not sure where to check for this in the code).

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              jesse_yates Jesse Yates
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: