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.
- is blocked by
HIVE-10788 Change sort_array to support non-primitive types
- links to