1
votes

I have a hive table with a column of the below datatype:

map<int,struct<mot:bigint,id:bigint>>

I am trying to read the value for id from the map using lateral view explode and it throws the below error :

 select value.id from my_table lateral view explode(my_map) value  limit 10;
FAILED: SemanticException [Error 10002]: Line 1:14 Invalid column reference 'id'

Can anyone help me to read a struct value from a map.

1

1 Answers

1
votes
select val.id from my_table lateral view explode(my_map) new_col as key,val limit 10;