Support Questions
Find answers, ask questions, and share your expertise

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.