pig:group by之后的其它统计方法一
摘要:
1 --测试Top N后的其它统计 2 A = LOAD '/TraceParser/blackcore/' USING PigStorage() as (lk_id:chararray,host:chararray); 3 --DUMP A; 4 5 B = GROUP A BY lk_id; 6 B = FOREACH B GENERATE group as lk_id,COUNT($1) as amount; 7 --DUMP B; 8 9 --TOP N的数据集10 C = ORDER B BY amount DESC;11 C = LIMIT C 5;12 --DUM 阅读全文
posted @ 2013-10-22 11:44 blackcore 阅读(2646) 评论(0) 推荐(0) 编辑