title: Workaround to query array column as rows in Impala
body: <p>In Hive, I can use <code>explode</code> function but how to do that in Impala?</p>
  
  <p>I read this but still have no clue:</p>
  
  <p><a href="https://stackoverflow.com/questions/47436977/is-there-a-function-equivalent-to-hives-explode-function-in-apache-impala">Is there a function equivalent to Hive&#39;s &#39;explode&#39; function in Apache Impala?</a></p>
  
  <p>This is how I created the table in Hive:</p>
  
  <pre><code>create table tb (arr_col array&lt;string&gt;)
  
  insert into tb select array ('A','B') from (select 'temp') x
  </code></pre>
  
  <p>My query would give error:</p>
  
  <pre><code>select tb.arr_col from tb
  
  ..in select list returns a complex type 'ARRAY&lt;STRING&gt;'.
  Only scalar types are allowed in the select list.
  </code></pre>
  
  <p>OR </p>
  
  <pre><code>select tb.arr_col.item from tb
  
  ERROR: AnalysisException: Illegal column/field reference 'arr_col.item' with intermediate collection 'item' of type 'ARRAY&lt;STRING&gt;'
  </code></pre>
  
  <p>Please advise the best way.
   Thanks</p>