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

collect_list() and collect_set() should accept struct types as argument

Log workAgile BoardRank to TopRank to BottomVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0, 2.0.0
    • Component/s: UDF
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      The collect_list() and collect_set() functions currently only accept scalar argument types. It would be very useful if these functions could also accept struct argument types for creating nested data from flat data.
      For example, suppose I wanted to create a nested customers/orders table from two flat tables, customers and orders. Then it'd be very convenient to write something like this:

      insert into table nested_customers_orders
      select c.*, collect_list(named_struct("oid", o.oid, "order_date": o.date...))
      from customers c inner join orders o on (c.cid = o.oid)
      group by c.cid
      

      Thanks you for your consideration.

        Attachments

        1. HIVE-10427.1.patch
          23 kB
          Chao Sun
        2. HIVE-10427.2.patch
          36 kB
          Chao Sun
        3. HIVE-10427.3.patch
          47 kB
          Chao Sun
        4. HIVE-10427.4.patch
          46 kB
          Chao Sun

        Issue Links

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment