我有以下一组配置单元表:
create table image_additions (
customer_id STRING,
image_key STRING,
image_size STRING
);
create table image_removals (
customer_id STRING,
image_key STRING,
image_size STRING
);
create table images_stored (
customer_id STRING,
image_key STRING,
image_size STRING
);
我想从如下查询中运行insert:
insert into images_stored
select ia.customer_id,
ia.image_key,
ia.image_size
from image_additions ia
where ia.image_key not in
(select ir.image_key from image_removals ir);
这会产生笛卡尔积,而hive不允许我运行它。如何使用另一个查询来实现这一点?
1条答案
按热度按时间zdwk9cvp1#
使用left join+where为null;
使用不存在: