Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
None
-
None
-
None
-
None
-
i686 i386 GNU/Linux
Description
This is a bug int he Schema comparison for casting. This is a valid use of a cast in SUM, the first and second arguments are a cast to a Bag with an int.
ERROR 1045: Could not infer the matching function for org.apache.pig.builtin.SUM as multiple or none of them fit. Please use an explicit cast.
TEST: AggregateFunc_61
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 SUM ( ( BAG
) A.Fbag.age);
STORE X INTO '/user/pig/tests/results/araceli.1234465985/AggregateFunc_61.out' USING PigStorage();
Suggest you also try:
X =FOREACH B GENERATE SUM ( ( BAG
) A.Fbag.age, A.Fint );
Attachments
Issue Links
- is duplicated by
-
PIG-904 Conversion from double to chararray for udf input arguments does not occur
- Closed