I have a hive table with the following schema:
COOKIE | PRODUCT_ID | CAT_ID | COL
1234123 [1,2,3] [r, t, null] [2,1, null]
How can I normalize arrays to get the following result
COOKIE | PRODUCT_ID | CAT_ID | COL
1234123 [1] [r] [2]
1234123 [2] [t] [1]
1234123 [3] null null
I tried the following:
select concat_ws('|',visid_high,visid_low) as cookie ,pid ,catid ,qty from table lateral view explode(productid) ptable as pid lateral view explode(catalogId) ptable2 as catid lateral view explode(qty) ptable3 as qty
however, the result is deduced as a Cartesian product.
hive explode hiveql
user2726995
source share