Hive 和选择不匹配的记录

Hive and selecting non matching records

我有两个 table 像 table A 和 B,我需要 select A 和 B 的非匹配记录(即 A 减去 B)。 A 有多列,B 是单列 ( ID) 。

我已经尝试过如下方法,但它花费了太多时间

Select * from A where A.ID <> ( select B.ID from B).

我也试过了

Select * from A left outer join on B where A.ID = B.ID AND B.ID IS NULL 

显示错误的结果

请帮我确定解决方案。

谢谢。

使用 where 子句进行过滤。

 Select * from A left outer join  B on A.ID = B.ID where B.ID IS NULL