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

Support table function calls in FROM clause without TABLE() wrapper

    XMLWordPrintableJSON

Details

    Description

      Currently, when selecting from a table function, the function call needs to be wrapped in TABLE() like this:

          SELECT * FROM TABLE(table_func('args'));

      Many dialects (SQL Server, PostgreSQL, BigQuery) do not require this:

          SELECT * FROM table_func('args');

      The current Calcite grammar can be extended to permit this syntax without conflicting with other productions.

      There is a close call with the dynamic columns feature used by Phoenix

          SELECT * FROM EventLog(lastGCTime TIME)

      It can be disambiguated with 3 tokens of lookahead, seeing past the '(' and identifier to the presence of a type production. The table extension clause for dynamic columns requires at least one field, so the empty case of '()' is not ambiguous either.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              barrkel Barry Kelly
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified