我有一个名为exampleTable的表,其中包含两列字符串数组。
Array<string> col1 Array<string> col2
["a", "b" , "c" ] ["x","y","z"]
["aa", "bb" , "cc" ] ["xx","yy","zz"]
我的目标是制作一个像这样的表
col1 col2
"a" "x"
"b" "y"
"c" "z"
"aa" "xx"
"bb" "yy"
"cc" "zz"
我想过使用LATERL VIEW,如:
SELECT myCol1, myCol2 FROM exampleTable
LATERAL VIEW explode(col1) myTable1 AS myCol1
LATERAL VIEW explode(col2) myTable2 AS myCol2;
但这会产生这个
col1 col2
"a" "x"
"a" "y"
"a" "z"
"a" "xx"
"a" "yy"
"a" "zz"
"b" "x"
"b" "y"
"b" "z"
"b" "xx"
"b" "yy"
"b" "zz"
"c" "x"
"c" "y"
"c" "z"
"c" "xx"
"c" "yy"
"c" "zz"
"aa" "x"
"aa" "y"
"aa" "z"
"aa" "xx"
"aa" "yy"
"aa" "zz"
"bb" "x"
"bb" "y"
"bb" "z"
"bb" "xx"
"bb" "yy"
"bb" "zz"
"cc" "x"
"cc" "y"
"cc" "z"
"cc" "xx"
"cc" "yy"
"cc" "zz"
我该如何解决这个问题? 提前谢谢。