Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Construct new array from existing values in a array in Hive

Highlighted

Construct new array from existing values in a array in Hive

New Contributor

I have a array of values in hive table for particular column which is of data type array of struct like below.

[{"A":["1","2","3"],"B":["X","Y",Z"],"C":["PQ","RS","TU"]}]

I need to reconstruct the array as below and insert into target table.

[{"A":"1","B":"X","C":"PQ"},{"A":"2","B":"Y","C":"RS"},{"A":"3","B":"Z","C":"TU"}

Please let me know if we can do this in Hive.

Don't have an account?
Coming from Hortonworks? Activate your account here