Hi,
You will need to GROUP before you do a COUNT here.
grunt> A = load '/tmp/test_file' using PigStorage(',') as (uid:long,
payload:bytearray, ts:long, type:int);
grunt> B = GROUP A BY (uid), //Or B = GROUP A ALL;
grunt> C = foreach B generate group, COUNT(A);
Thanks,
Prashant
On Wed, Feb 8, 2012 at 6:13 PM, Haitao Yao <[email protected]> wrote:
> hi, all
> here's my pig script:
> grunt> A = load '/tmp/test_file' using PigStorage(',') as (uid:long,
> payload:bytearray, ts:long, type:int);
> grunt> B = foreach A generate COUNT(A);
> 2012-02-08 17:55:44,647 [main] ERROR org.apache.pig.tools.grunt.Grunt -
> ERROR 1200: Pig script failed to parse:
> <line 4, column 29> Invalid scalar projection: A : A column needs to be
> projected from a relation for it to be used as a scalar
> Details at logfile: /tmp/pig_1328694479593.log
>
> what does ERROR 1200 mean?
>
> How can I find all the meanings of error codes in Pig?
>
> thanks.