Created
August 8, 2013 20:46
-
-
Save matthayes/6188548 to your computer and use it in GitHub Desktop.
When joining on more than two relations, one option is to use multiple joins. However this means multiple MapReduce jobs, which is inefficient.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input1 = LOAD 'input1' using PigStorage(',') AS (val1:INT,val2:INT); | |
input2 = LOAD 'input2' using PigStorage(',') AS (val1:INT,val2:INT); | |
input3 = LOAD 'input3' using PigStorage(',') AS (val1:INT,val2:INT); | |
data1 = JOIN input1 BY val1 LEFT, input2 BY val1; | |
data1 = FILTER data1 BY input1::val1 IS NOT NULL; | |
data2 = JOIN data1 BY input1::val1 LEFT, input3 BY val1; | |
data2 = FILTER data2 BY input1::val1 IS NOT NULL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment