title: lateral view explode in hive
body: <p>I have a table called exampleTable of two columns of arrays of strings.</p>
  
  <pre><code>Array&lt;string&gt; col1  Array&lt;string&gt; col2
  ["a", "b" , "c" ]       ["x","y","z"]
  ["aa", "bb" , "cc" ]       ["xx","yy","zz"]
  </code></pre>
  
  <p>My goal is produce a table like this </p>
  
  <pre><code>col1                   col2
  "a"                     "x"
  "b"                     "y"
  "c"                     "z"
  "aa"                     "xx"
  "bb"                     "yy"
  "cc"                     "zz"
  </code></pre>
  
  <p>I thought about using LATERL VIEW like :</p>
  
  <pre><code>SELECT myCol1, myCol2  FROM exampleTable
           LATERAL VIEW explode(col1) myTable1 AS myCol1
           LATERAL VIEW explode(col2) myTable2 AS myCol2;
  </code></pre>
  
  <p>but this produces this instead</p>
  
  <pre><code>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"
  </code></pre>
  
  <p>How can I tackle this?
  Thanks in advance.</p>