【发布时间】:2012-10-12 11:28:05
【问题描述】:
如果在 Hive 表中使用 map 类型,如何测试空条目(键存在,但值为空)?
有表:
test1 (id string, m map<string, string>)
我有一些看起来像这样的条目:
id1 {"b":"B","c":null}
id2 {"b":"B"}
如果我运行查询:
select * from test1 where m["c"] is null;
我会取回两行,因为表达式每次都计算为真。
如何在 key 存在和 value 为 null 之间进行测试?
【问题讨论】:
-
是的,我添加了自己的答案,但正在寻找反馈和/或其他解决方案
标签: hive