apache pig - Separate each file in a different bag from the folder -
i using pig latin analysis of previous t20 world cup matches. every match in separate csv file. , want find total no of 100's made players.
my approach : load each file using script:
t20 = load '/home/ankur/desktop/pig_scripts/t20_csv' using pigstorage(',') (inning,overs,team,stk,nstk,bowler,run,extra,type,name);
but using approach each file's data come same bag , that's why can't find no of 100's.
- if how each file come different bag can using foreach . can calculate.
is way of thing correct or not? suggest me if have other idea.
- load files
- filter records 'run' > 99
count filtered records
t20 = load '/home/ankur/desktop/pig_scripts/*' using pigstorage(',') (inning,overs,team,stk,nstk,bowler,run,extra,type,name); hundred_records = filter t20 (run > 99); total_hundreds = foreach hundred_records generate count(hundred_records);
Comments
Post a Comment