如果两个 table 的配置单元中有相似的列值,则比较两个 table 并从一个 table 中删除行
compare two tables and delete rows from one table if there are similar coumn values in two tables hive
Table description are in the link
Table 1 和 Table 2 有 A 和 D 行。我需要将这两个从 Table 2 中删除。
请检查下面的 link 以获得详细描述。谢谢。
您可以使用 LEFT JOIN
select 查询执行 INSERT OVERWRITE
。
INSERT overwrite TABLE table2
SELECT t2.*
from table2 t2
LEFT JOIN table1 t1
on (t1.x = t2.p) --use appropriate common column name
WHERE t1.x is NULL; --where there's no common element in t2
Table description are in the link
Table 1 和 Table 2 有 A 和 D 行。我需要将这两个从 Table 2 中删除。
请检查下面的 link 以获得详细描述。谢谢。
您可以使用 LEFT JOIN
select 查询执行 INSERT OVERWRITE
。
INSERT overwrite TABLE table2
SELECT t2.*
from table2 t2
LEFT JOIN table1 t1
on (t1.x = t2.p) --use appropriate common column name
WHERE t1.x is NULL; --where there's no common element in t2