Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18416

Initial support for TABLE function

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Parser

    Description

      Include support for TABLE function derived table. In SQL standard, it is defined as:

      <table function derived table> ::=
        TABLE <left paren> <collection value expression> <right paren>
      

      Further, include limited support for its usage as LATERAL derived table.

      This will allow Hive to execute queries such as:

      SELECT tf.col1, tf.col2, tf.col3
      FROM
        TABLE(VALUES('A', 10, 30.0),('B', 20, 30.0)) AS tf(col1, col2, col3);
      SELECT tf.col1, tf.col2, tf.col3
      FROM
        (SELECT key, value FROM src) t,
        LATERAL TABLE(VALUES('A', 10, t.key),('B', 20, t.key)) AS tf(col1, col2, col3);
      

      The idea is to rely on AST rewriting for such cases, as TABLE can be implemented using inline UDTF with an array of structs representing the rows in the VALUES clause.

      Attachments

        1. HIVE-18416.patch
          60 kB
          jcamachorodriguez
        2. HIVE-18416.01.patch
          1.58 MB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: