Created
September 23, 2012 22:57
-
-
Save criccomini/3773349 to your computer and use it in GitHub Desktop.
Hadoop, Pig, and SQL (JOIN)
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
SELECT * FROM mytable INNER JOIN othertable ON mytable.col1 = othertable.col1; | |
mytable = JOIN mytable BY col1, othertable BY col1; | |
DUMP mytable; | |
SELECT * FROM mytable LEFT OUTER JOIN othertable ON mytable.col1 = othertable.col1; | |
mytable = JOIN mytable BY col1 LEFT OUTER, othertable BY col1; | |
DUMP mytable; | |
SELECT * FROM mytable RIGHT OUTER JOIN othertable ON mytable.col1 = othertable.col1; | |
mytable = JOIN mytable BY col1 RIGHT OUTER, othertable BY col1; | |
DUMP mytable; | |
SELECT * FROM mytable FULL OUTER JOIN othertable ON mytable.col1 = othertable.col1; | |
mytable = JOIN mytable BY col1 FULL OUTER, othertable BY col1; | |
DUMP mytable; | |
SELECT * FROM mytable, othertable; | |
mytable = CROSS mytable, othertable; | |
DUMP mytable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment