hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-10427) collect_list() and collect_set() should accept struct types as argument
Date Thu, 21 May 2015 18:10:18 GMT

    [ https://issues.apache.org/jira/browse/HIVE-10427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14554767#comment-14554767
] 

Alexander Pivovarov commented on HIVE-10427:
--------------------------------------------

Should we open separate Jira for adding NON-Primitive array sort functionality to sort_array?
{code}
	modified:   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java
	deleted:    ql/src/test/queries/clientnegative/udf_sort_array_wrong3.q
	modified:   ql/src/test/results/clientnegative/udf_sort_array_wrong2.q.out
{code}
Can you also use common GenericUDF methods in GenericUDFSortArray if possible. I put one suggestion
on RB.

> collect_list() and collect_set() should accept struct types as argument
> -----------------------------------------------------------------------
>
>                 Key: HIVE-10427
>                 URL: https://issues.apache.org/jira/browse/HIVE-10427
>             Project: Hive
>          Issue Type: Wish
>          Components: UDF
>            Reporter: Alexander Behm
>            Assignee: Chao Sun
>         Attachments: HIVE-10427.1.patch, HIVE-10427.2.patch, HIVE-10427.3.patch
>
>
> 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:
> {code}
> 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
> {code}
> Thanks you for your consideration.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message