Query Map values in Hive
<p>I have a table in hive which is updated every hour by Spark/Parquet</p>
<pre><code>CREATE TABLE IF NOT EXISTS user
(
    name STRING,
    creation_date DATE,
    cards map&lt;STRING,STRING&gt;
) STORED AS PARQUET ; 
</code></pre>
<p>Let's suppose that I want to query the number of Gobelin cards per user.</p>
<p>My query looks like this:</p>
<pre><code> select * from user where card[&quot;Gobelin&quot;] IS NOT NULL ;
</code></pre>
<p>The result looks like this</p>
<pre><code>KillerZord1001      2016-01-02      {&quot;Archer&quot;:&quot;2&quot;,&quot;Gobelin&quot;:&quot;6&quot;}
HalfAMill       2016-02-05      {&quot;Witch&quot;:&quot;7&quot;,&quot;Gobelin&quot;:&quot;8&quot;}
</code></pre>
<p>But what I would like to have is the value of the key that I am looking for, more like:</p>
<pre><code>KillerZord1001      2016-01-02      6
HalfAMill       2016-02-05      8
</code></pre>
<p>Can Hive perform such queries?</p>