A = LOAD 'A.txt' USING PigStorage('\t') AS (a1:chararray,a2:int,a3:int,a4:int,a5:int);
B = LOAD 'B.txt' USING PigStorage('\t') AS (b1:chararray,b2:chararray,b3:int,b4:int,b5:int,b6:int);
B_New = FOREACH B GENERATE CONCAT(b1,b2) AS b1_new,b3,b4,b5,b6;
AB = JOIN A BY a1,B_New BY b1_new;
DUMP AB;
1条答案
按热度按时间ss2ws0br1#
您可以使用concat(b1,b2)作为b1\u new在关系b中生成一个新列,然后使用b\u new中的新列连接a和新关系