Create tables like this:
create table sample(mnth string,names map<string,string>,ids map<string,int>)
row format delimited fields terminated by ' ' map keys terminated by '=';
Select a query:
select mnth,names["name"],ids["id"] from sample;
result:
Jun "balaji" 101
Mar "kumar" 102
If you call select *from a sample:
Jun {"name":"\"balaji\""} {"id":101}
Mar {"name":"\"kumar\""} {"id":102}
To access each value on the map you need to go through how names["name"].
source
share