Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None

      Description

      The "dual" table in MySQL and Oracle is very convenient in testing UDFs or constructing rows without reading any other tables.

      If dual is the only data source we could leverage the local mode execution.

        Issue Links

          Activity

          Hide
          John Sichi added a comment -

          SQL standard has the VALUES clause, so you can do

          INSERT INTO t VALUES(3, 'hi'); – inserts one row

          INSERT INTO t VALUES (3, 'hi'), (4, 'bye'); – inserts two rows

          and

          SELECT * FROM (VALUES(3, 'hi'), (4, 'bye')) – inline table results

          If we add dual, it would also be nice to support at least the standard INSERT syntax since that has been around forever.

          Show
          John Sichi added a comment - SQL standard has the VALUES clause, so you can do INSERT INTO t VALUES(3, 'hi'); – inserts one row INSERT INTO t VALUES (3, 'hi'), (4, 'bye'); – inserts two rows and SELECT * FROM (VALUES(3, 'hi'), (4, 'bye')) – inline table results If we add dual, it would also be nice to support at least the standard INSERT syntax since that has been around forever.
          Hide
          Edward Capriolo added a comment -

          I created a DualInputFormat that can be used to easily create a dual table.

          https://github.com/edwardcapriolo/DualInputFormat.

          Show
          Edward Capriolo added a comment - I created a DualInputFormat that can be used to easily create a dual table. https://github.com/edwardcapriolo/DualInputFormat .
          Hide
          Maxime LANCIAUX added a comment -

          What do you think about modify Hive.g and add a token for DUAL ?

          Show
          Maxime LANCIAUX added a comment - What do you think about modify Hive.g and add a token for DUAL ?
          Hide
          Ken Williams added a comment -

          What advantage does creating a "DUAL" have, over just letting the caller omit the "FROM..." altogether? In MySQL, one can just do SELECT 5+5; without a FROM clause, which has always seemed more natural to me.

          Show
          Ken Williams added a comment - What advantage does creating a "DUAL" have, over just letting the caller omit the "FROM..." altogether? In MySQL, one can just do SELECT 5+5; without a FROM clause, which has always seemed more natural to me.
          Hide
          Ken Williams added a comment -

          John Sichi - I think that's mostly a separate issue from this one. SELECT * FROM (VALUES ...) is related, but not really tied to DUAL.

          Show
          Ken Williams added a comment - John Sichi - I think that's mostly a separate issue from this one. SELECT * FROM (VALUES ...) is related, but not really tied to DUAL.

            People

            • Assignee:
              Marcin Kurczych
              Reporter:
              Ning Zhang
            • Votes:
              8 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:

                Development