Skip to content

Instantly share code, notes, and snippets.

@tomgullo
Created September 14, 2009 02:47
Show Gist options
  • Save tomgullo/186460 to your computer and use it in GitHub Desktop.
Save tomgullo/186460 to your computer and use it in GitHub Desktop.
wordcount using hadoop pig
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';
@heyashutosh
Copy link

Thank you. That helped.

Could you please tell me if I have to find the similar words from the sheet then how to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment