Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Join Multiple Relations by Different Fields


+
Thomas Bach 2012-12-14, 10:11
Copy link to this message
-
Re: Join Multiple Relations by Different Fields
Hi all,

I got a hint via StackOverflow[1] the problem was the missing
delimiter definition

On Fri, Dec 14, 2012 at 11:11:43AM +0100, Thomas Bach wrote:
> grunt> data1 = load 'data1' as (key: chararray, val: chararray);  
> grunt> data2 = load 'data2' as (key: chararray, val: chararray);  
> grunt> assoc = load 'assoc' as (key1: chararray, key2: chararray);

this should read

data1 = load 'data1' using PigStorage(',') as (key: chararray, val: chararray);  
data2 = load 'data2' using PigStorage(',') as (key: chararray, val: chararray);  
assoc = load 'assoc' using PigStorage(',') as (key1: chararray, key2: chararray);

I got confused because the original statement yielded

grunt> dump data1;
(key1,foo,)
(key2,bar,)

So I took for granted that this is a tupleā€¦

Sorry for the noise,

      Thomas Bach.

Footnotes:
[1]  http://stackoverflow.com/questions/13861570/join-multiple-relations-by-different-fields
+
Jonathan Coveney 2012-12-14, 18:54
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB