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

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

    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

              People

              • Assignee:
                csun Chao Sun
                Reporter:
                alex.behm Alexander Behm
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: