我正在尝试在蜂巢中运行一个查询,该查询涉及在同一张表中内联2个数组,并使用NOT IN运算符有效地吸收差异
select c1 from t1
lateral view inline(m1) m1
where m1.key = 'x'
AND t1.c1 NOT IN
(
select c1 from t1
lateral view inline(m2) m2
where m2.key = 'y'
);
以上查询返回
FAILED: NullPointerException null
答案 0 :(得分:1)
首先过滤出所有具有值'y'的c1
With temp as
(select distinct c1 from t1
lateral view inline(m2) m2
where m2.key = 'y')
select c1 from t1
lateral view inline(m1) m1
where m1.key = 'x')
and c1 not in (select c1 from temp)