Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

rewrite equivalent pig script

$
0
0
The following pig script hangs due to a bug. Is there a different way to
rewrite it and achieve the same functionality? Any ideas to do things
differently are appreciated.

tWeek = LOAD '/tmp/test_data.txt' USING PigStorage ('|') AS (WEEK:int,
DESCRIPTION:chararray, END_DATE:chararray, PERIOD:int);

gTWeek = FOREACH tWeek GENERATE WEEK AS WEEK, PERIOD AS PERIOD;

pWeek = FILTER gTWeek BY (PERIOD == 201312);

pWeekRanked = RANK pWeek BY WEEK ASC DENSE;

gpWeekRanked = FOREACH pWeekRanked GENERATE $0;

store gpWeekRanked INTO 'gpWeekRanked2';

describe gpWeekRanked2;

Thanks,
Suhas.

Viewing all articles
Browse latest Browse all 5648

Trending Articles