Friday, May 8, 2015

Script Mode : Join Script in Apache Pig

A = LOAD 'data1.txt' using PigStorage('\t') as (cid:int,name:chararray,place:chararray);

B = LOAD 'data2.txt' using PigStorage('\t') as (cid:int,name:chararray,place:chararray);

joindata = JOIN A By cid,B By cid;

rjoin = JOIN A By cid RIGHT,B By cid;

ljoin = JOIN A By cid LEFT,B By cid;

Fjoin = JOIN A By cid FULL,B BY cid;

DUMP rjoin;DUMP ljoin;DUMP Fjoin;

No comments:

Post a Comment