1) The initial load data (previous day data) is in hdfs - Relation A
2) Import the current data into HDFS using sqoop -- Relation B
3) Use pig Load the above two hdfs directories in relation A and B define schema.
4) Convert them to tuples and join them by all columns
5) The join result will have two tuples in each row((A,B),(A,B)) , fetch the result from join where tuple B is null ((A,D),).
6) Now flatten the join by tuple A you will have new/updated records(A,D).
1条答案
按热度按时间unguejic1#
其思想是通过一些列或所有列将两个数据集左连接起来,然后找到右侧为null的位置,这样我们就只需要加载新的记录
您可以按照以下步骤操作