Skip to content

Instantly share code, notes, and snippets.

@railsfactory-pramod
Created June 27, 2012 19:09
Show Gist options
  • Save railsfactory-pramod/3006105 to your computer and use it in GitHub Desktop.
Save railsfactory-pramod/3006105 to your computer and use it in GitHub Desktop.
Pig for wor count
A = load '/tmp/alice.txt';
B = foreach A generate flatten(TOKENIZE((chararray)$0)) as word;
C = filter B by word matches '\\w+';
D = group C by word;
E = foreach D generate COUNT(C), group;
store E into '/tmp/alice_wordcount';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment