Wednesday, August 14, 2013

Word Count In Pig

Figuring out Github. Will post the code there once its done. :)

A = LOAD 'Nameipfile' using TextLoader();
B = FOREACH  A GENERATE FLATTEN(TOKENIZE($0)) as word;
C= FOREACH ( GROUP B by word ) GENERATE, GROUP  as word, COUNT($1) as ct;
Dump C;

No comments:

Post a Comment