apache pig - Joining multiple relations using a common field in Pig not giving any output -
i have 2 relations r1 , r2.
grunt>describe r1; r1: {f1: chararray,ts: chararray} grunt>describe r2; r2: {f2:chararray,ts: chararray}
i want join 2 relations on ts output this
(f1,f2)
this tried (did not find comments relevant case).
grunt>j = join r1 ts,r2 ts; grunt>o = foreach j generate concat(r1::f1,r2::f2); grunt>describe o; o: {chararray} grunt>dump o;
i not getting output on dump o. new pig please explain.
here data i'm using :
data1
f1a 10 f1b 12
data2
f2a 10 f2b 11 f2c 12
if run following script, produces expected result:
grunt> = load 'data1' (f1:chararray, ts:int); grunt> b = load 'data2' (f2:chararray, ts:int); grunt> c = join ts, b ts; grunt> describe c; c: {a::f1: chararray,a::ts: int,b::f2: chararray,b::ts: int} grunt> d = foreach c generate concat(f1, f2); grunt> dump d (f1af2a) (f1bf2c)
Comments
Post a Comment