hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Robertson <>
Subject Opposite of explode?
Date Fri, 11 Feb 2011 04:13:54 GMT
Hi all,

Sorry if I am missing something obvious but is there an inverse of an explode?

E.g. given t1

ID Name
1  Tim
2  Tim
3  Tom
4  Frank
5  Tim

Can you create t2:

Name ID
Tim    1,2,5
Tom   3
Frank 4

In Oracle it would be a
  select name,collect(id) from t1 group by name

I suspect in Hive it is related to an Array but can't find the syntax

Thanks for any pointers,

View raw message