apache pig - Pig sum on data -
i have file - (1950,10) (1951,33) (1952,15) (1953,17) (1954,17) (1955,14) (1956,60) (1957,98) (1958,73) (1959,87) (1960,123)
i want sum of second field through pig. eg out put should (547)
please help
you can this. have group records..
x = load '/root/stack.txt' using pigstorage(',') (year:int,score:int); y = group x all; z = foreach y generate sum(x.score); dump z;
answer:
(547)
is solves problem......
Comments
Post a Comment