Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

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


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