title: How to get length of complex datatype column in hive
body: <p>I have a hive table contains columns of type <code>array</code> and <code>map</code> and I want to filter record where array/map column contains more than <strong>N</strong> elements, how to do that? </p>
  
  <p><strong>DDL:</strong></p>
  
  <pre><code>create table test (id string, v1 array&lt;int&gt;, v2 map&lt;string,string&gt;)
  </code></pre>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>select * from test where length(v1)&gt;10 or length(v2)&gt;10
  </code></pre>