I am trying to search a column having the data type map(varchar,varchar). Now one way to access the column is to use this structure, name_of_column['key'], which will give the value for that key. But I want to know what are possible keys and then apply group by and other operations based on those keys.
I tried searching on the internet but was not able to find appropriate solution.
Presto offers map_keys
function for that:
presto> select map_keys(map(array['alice'], array['has a cat']));
_col0
---------
[alice]
(1 row)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With