title: Extract value from Row object
body: <p>Following the office documentation <a href="https://trino.io/docs/current/functions/map.html" rel="nofollow noreferrer">https://trino.io/docs/current/functions/map.html</a>. I use &quot;map_entries&quot; break map into array(row(K, V)) structure. My question is how to extract K and V value from the row object? Currently I have to recast it to a Row object that I defined.</p>
  <pre class="lang-sql prettyprint-override"><code>select 
      type.n , type.b
  from
      (select  
           CAST(type AS ROW(n VARCHAR, b VARCHAR)) as type
       from 
           search.yli_tmp_trevi_requests_mini
       cross join 
           unnest (map_entries(cast(json_extract(req, '$.types') as MAP&lt;VARCHAR, VARCHAR&gt;))) t (type)
      ) t
  where 
      type.n = 'apple'
  </code></pre>