Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
-
i686 i386 GNU/Linux
Description
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