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

Table-valued function TUMBLE uses non-standard syntax

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.22.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      The currently supported syntax is this:

      SELECT * FROM TABLE(TUMBLE(TABLE my_table, ...
      

      But the SQL standard specifies that my_table must be in parentheses, such as here:

      SELECT * FROM TABLE(TUMBLE(TABLE(my_table), ...
      

      The second syntax is currently rejected with:

      Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: Encountered "(" at line 1, column 33.
      Was expecting one of:
          <BRACKET_QUOTED_IDENTIFIER> ...
          <QUOTED_IDENTIFIER> ...
          <BACK_QUOTED_IDENTIFIER> ...
          <IDENTIFIER> ...
          <UNICODE_QUOTED_IDENTIFIER> ...
      
      

      I'm not sure if the currently supported syntax is optional, but I think it's not.

      I followed this document: http://standards.iso.org/ittf/PubliclyAvailableStandards/c069776_ISO_IEC_TR_19075-7_2017.zip

      The TABLE clause acts in both ways: (1) to convert a table value to a table object (when used in the FROM clause to convert the function result) and (2) to convert a table object to a table value (when used to convert arguments to a function).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amaliujia Rui Wang
                Reporter:
                vilo Viliam Durina
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: