Last active
August 29, 2015 13:57
-
-
Save natbusa/9740337 to your computer and use it in GitHub Desktop.
Word count: in pig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A = load 'wordcount-input/lorem.txt' as (line:chararray); | |
B = foreach A generate FLATTEN(TOKENIZE(line)) as word; | |
C = foreach B generate LOWER(REPLACE(word,'\\W+','')) as word; | |
D = group C by word; | |
E = foreach D generate group, COUNT(C); | |
store E into 'wordcount-pig-output'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment