[
https://issues.apache.org/jira/browse/PIG-671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004096#comment-13004096
]
Deepak Kumar V commented on PIG-671:
------------------------------------
The following scenarios were tested with the patch.
input.txt
1 2 3 4
a b c d
r s t u
Script #1:
grunt> a = load 'test.txt' ;
grunt> b = group a all;
grunt> x = foreach b generate COUNT(a);
grunt> dump x;
Output(s):
Successfully stored records in: "file:/tmp/temp451361479/tmp-1035885131"
(3)
Script #2:
grunt> a = load 'test.txt' ;
grunt> b = group a all;
grunt> x = foreach b generate COUNT(a.$0);
grunt> dump x;
Output(s):
Successfully stored records in: "file:/tmp/temp451361479/tmp1005936870"
(3)
Script #3:
grunt> a = load 'test.txt' ;
grunt> b = group a all;
grunt> x = foreach b generate COUNT(a.$0,a.$0);
grunt> dump x;
2011-03-08 23:26:54,554 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
1045: Could not infer the matching function for org.apache.pig.builtin.COUNT as
multiple or none of them fit. Please use an explicit cast.
Script #4:
grunt> a = load 'test.txt' ;
grunt> b = group a all;
grunt> x = foreach b generate COUNT(a.$0,a);
grunt> dump x;
2011-03-08 23:26:59,397 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
1045: Could not infer the matching function for org.apache.pig.builtin.COUNT as
multiple or none of them fit. Please use an explicit cast.
grunt>
> typechecker does not throw an error when multiple arguments are passed to
> COUNT
> -------------------------------------------------------------------------------
>
> Key: PIG-671
> URL: https://issues.apache.org/jira/browse/PIG-671
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.0
> Environment: i686 i386 GNU/Linux
> Reporter: Araceli Henley
> Assignee: Deepak Kumar V
> Priority: Trivial
> Fix For: 0.9.0
>
>
> In this example, the agggregate function COUNT is passed multiple arguments
> and does not throw an error.
> TEST: Aggregate_184
> A =LOAD '/user/pig/tests/data/types/DataAll' USING PigStorage() AS (
> Fint:int, Flong:long, Fdouble:double, Ffloat:float, Fchar:chararray,
> Fchararray:chararray, Fbytearray:bytearray, Fmap:map[], Fbag:BAG{ t:tuple(
> name, age, avg ) }, Ftuple:( name:chararray, age:int, avg:float) );
> B =GROUP A ALL;
> X =FOREACH B GENERATE COUNT ( A.$0, A.$0 );
> STORE X INTO
> '/user/pig/tests/results/araceli.1234381533/AggregateFunc_184.out' USING
> PigStorage();
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira