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.

  1. load files
  2. filter records 'run' > 99
  3. 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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -