答案 0 :(得分:2)
查询行where event_detail["value(B)"] is not null
:
select visitor_number
from table
where event_detail["value(B)"] is not null
<强>演示:强>
创建测试表:
hive> create table test_t(visitor_number int,event_detail map<string,string>);
OK
加载数据:
hive> insert into test_t select 123, map("value(B)","Bye") union all select 123, map("value(G)","Jet");
OK
选择值为(B)的行:
hive> select visitor_number from test_t where event_detail["value(B)"] is not null;
OK
123