How to do outer join on two columns in Pig Latin

hese picture hese · Nov 7, 2011 · Viewed 25.3k times · Source

I do outer joins on single columns in Pig like this

result = JOIN A by id LEFT OUTER, B by id;

How do I join on two columns, something like -

WHERE A.id=B.id AND A.name=B.name

What is the pig equivalent? I couldn't find any example in the pig manuals...any help?

Answer

Samuel Kerrien picture Samuel Kerrien · Aug 21, 2012

The above answer is actually an INNER join, the correct pig statement should be:

 join a by (id, name) LEFT OUTER, b by (id, name)