hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Araceli Henley (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-673) several aggregate functions do not check the number of arguments and do not correctly check for a type "bag"
Date Thu, 12 Feb 2009 20:12:59 GMT
several aggregate functions do not check the number of arguments and do not correctly check
for a type "bag"
------------------------------------------------------------------------------------------------------------

                 Key: PIG-673
                 URL: https://issues.apache.org/jira/browse/PIG-673
             Project: Pig
          Issue Type: Bug
         Environment: i686 i386 GNU/Linux

            Reporter: Araceli Henley



DIFF expects two bags as the argument. But in this negative test case we pass:
1) there is a single argument to diff instead of two,
2) The argument should be a bag but is an int.

TEST: AggregateFunc_190

 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  DIFF( A.Fint) + DIFF( A.Fint); 
STORE X INTO '/user/pig/tests/results/araceli.1234381533/AggregateFunc_190.out' USING PigStorage();

ERROR 1000: Error during parsing. Atomic field expected but found non-atomic field

TEST AggregateFunc_1901 

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  DIFF( A.Fint, A.Fint) + DIFF( A.Fint, A.Fint);
 STORE X INTO '/user/pig/tests/results/araceli.1234467894/AggregateFunc_1901.out' USING PigStorage();

ERROR 1000: Error during parsing. Atomic field expected but found non-atomic field

TEST AggregateFunc_1902 

 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  DIFF( A.Fint, A.Fint + A.Fint); 
STORE X INTO '/user/pig/tests/results/araceli.1234467894/AggregateFunc_1902.out' USING PigStorage();

throws error: ERROR 1039: Incompatible types in Add Operator left hand side:bag right hand
side:bag

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message