I have two tables, namely table1
and table2
. table1
is big, whereas table2
is small. Also, I have a UDF function whose interface is defined as below:
--table1--
id
1
2
3
--table2--
category
a
b
c
d
e
f
g
UDF: foo(id: Int): List[String]
I intend to call UDF firstly to get the corresponding categories: foo(table1.id)
, which will return a WrappedArray, then I want to join every category
in table2
to do some more manipulation. The expected result should look like this:
--view--
id,category
1,a
1,c
1,d
2,b
2,c
3,e
3,f
3,g
I try to find a unnest method in Hive, but with no luck, could anyone help me out? Thanks!