2

文字列の配列の2つの列の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"

私はLATERLVIEWを次のように使用することを考えました:

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"

どうすればこれに取り組むことができますか?前もって感謝します。

4

1 に答える 1