PIG how to count a number of rows in alias

前端 未结 7 1848
盖世英雄少女心
盖世英雄少女心 2020-12-07 11:03

I did something like this to count the number of rows in an alias in PIG:

logs = LOAD \'log\'
logs_w_one = foreach logs generate 1 as one;
logs_group = group         


        
7条回答
  •  庸人自扰
    2020-12-07 11:45

    Be careful, with COUNT your first item in the bag must not be null. Else you can use the function COUNT_STAR to count all rows.

提交回复
热议问题