计算数据总行数
rows= LOAD '/your/data/path';
g= GROUP rows ALL;
total_count = FOREACH g GENERATE COUNT(rows);
DUMP total_count;
g= GROUP rows ALL;
total_count = FOREACH g GENERATE COUNT(rows);
DUMP total_count;
world count:
a = load '/user/hue/word_count_text.txt';
b = foreach a generate flatten(TOKENIZE((chararray)$0)) as word;
c = group b by word;
d = foreach c generate COUNT(b), group;
store d into '/user/hue/pig_wordcount';
b = foreach a generate flatten(TOKENIZE((chararray)$0)) as word;
c = group b by word;
d = foreach c generate COUNT(b), group;
store d into '/user/hue/pig_wordcount';