Pig, mail # user - rewrite equivalent pig script - 2014-03-13, 00:37
 Search Hadoop and all its subprojects:

Switch to Threaded View
Copy link to this message
-
rewrite equivalent pig script
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.

 
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