[ https://issues.apache.org/jira/browse/HIVE-11022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15400781#comment-15400781 ]
Dudu Markovitz commented on HIVE-11022: --------------------------------------- In order to support complex ordering expressions I would suggest to add the sorting option as an enhanced syntax for the current functions and not as additional functions, in a similar way to MySQL's GROUP_CONCAT or Oracle's LISTAGG. It would also be nice to add the SEPARATOR /DELIMITER option. http://dev.mysql.com/doc/refman/5.7/en/group-by-functions.html#function_group-concat http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions089.htm#SQLRF30030 > Support collecting lists in user defined order > ---------------------------------------------- > > Key: HIVE-11022 > URL: https://issues.apache.org/jira/browse/HIVE-11022 > Project: Hive > Issue Type: New Feature > Components: UDF > Reporter: Michael Haeusler > > Hive currently supports aggregation of lists "in order of input rows" with > the UDF collect_list. Unfortunately, the order is not well defined when > map-side aggregations are used. > Hive could support collecting lists in user-defined order by providing a UDF > COLLECT_LIST_SORTED(valueColumn, sortColumn[, limit]), that would return a > list of values sorted in a user defined order. An optional limit parameter > can restrict this to the n first values within that order. > Especially in the limit case, this can be efficiently pre-aggregated and > reduces the amount of data transferred to reducers. -- This message was sent by Atlassian JIRA (v6.3.4#6332)