{"id":2953,"date":"2013-07-02T11:30:47","date_gmt":"2013-07-02T16:30:47","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=2953"},"modified":"2013-07-02T11:30:47","modified_gmt":"2013-07-02T16:30:47","slug":"joining-data-in-pig","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2013\/07\/02\/joining-data-in-pig\/","title":{"rendered":"Joining data in Pig"},"content":{"rendered":"<p>If you are an RDBMS person that is used to joining data from tables, you will be happy to know that this capability exists in Pig.<\/p>\n<p>Below is a very simple example.<\/p>\n<pre lang=\"text\">\r\ngrunt> fs -cat \/people\r\n1,1,steve howard\r\n2,1,becky howard\r\n3,2,john smith\r\n4,2,susan smith\r\n5,3,jeff wilson\r\n6,3,regina wilson\r\ngrunt> fs -cat \/address\r\n1,7768 farm hill dr.,blacklick, oh , 43004\r\n2,123 anywhere ave.,columbus, oh, 43215\r\n3,456 stingle st.,louisville, ky, 12345\r\ngrunt> p1 = load '\/people' using PigStorage(',');\r\ngrunt> p2 = load '\/address' using PigStorage(',');\r\ngrunt> jnd = join p1 by $1, p2 by $0;\r\ngrunt> dump jnd;\r\n(2,1,becky howard,1,7768 farm hill dr.,blacklick, oh , 43004)\r\n(1,1,steve howard,1,7768 farm hill dr.,blacklick, oh , 43004)\r\n(4,2,susan smith,2,123 anywhere ave.,columbus, oh, 43215)\r\n(3,2,john smith,2,123 anywhere ave.,columbus, oh, 43215)\r\n(6,3,regina wilson,3,456 stingle st.,louisville, ky, 12345)\r\n(5,3,jeff wilson,3,456 stingle st.,louisville, ky, 12345)\r\ngrunt>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you are an RDBMS person that is used to joining data from tables, you will be happy to know that this capability exists in Pig. Below is a very simple example. grunt> fs -cat \/people 1,1,steve howard 2,1,becky howard&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2013\/07\/02\/joining-data-in-pig\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[19,46],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2953"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2953"}],"version-history":[{"count":6,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2953\/revisions"}],"predecessor-version":[{"id":3148,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/2953\/revisions\/3148"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2953"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}