Hi All,
I am trying to run multiple group operations to calculate the max count of
a sub-group.
However , I am getting the below error while using group operation . Please
help if you know of a solution.
“[main] ERROR org.apache.pig.tools.grunt.Grunt – ERROR 1200: Pig script
failed to parse:
expression is not a project expression: (Name: ScalarExpression) Type: null
Uid: null)”
This is my code so far
individualHist = LOAD ‘/nfs/data/cdom_faster/csv/WeekendIndividual.csv’
USING PigStorage(‘,’) AS (card_no:chararray, org:int, des:int, n_hour:int,
count:int);
grpCOD = group individualHist by (card_no,org,des);
grpCOD_cnt = foreach grpCOD generate group.card_no as card_no, group.org as
org, group.des as des, SUM(individualFarecardHist.count) as CODcount;
grpCO = group individualFarecardHist by (card_no,org);
result = foreach grpCO{
totalCount = SUM(grpCOD_cnt.CODcount);
srtd_counts = order grpCOD_cnt by CODcount desc;
highest_count = limit srtd_counts 1;
generate FLATTEN(highest_count),totalCount;
};