hive实现not in

当前HIVE 不支持 not in 中包含查询子句的语法,形如如下的HQ语句是不被支持的: 

查询在key字段在a表中,但不在b表中的数据

select a.key from a where key not in(select key from b)  该语句在hive中不支持

可以通过left outer join进行查询,(假设B表中包含另外的一个字段 key1 

select a.key from a left outer join b on a.key=b.key where b.key1 is null

原文地址:https://www.cnblogs.com/ancientmoon/p/2718637.html