here is the partial code (omitted code before this portion is already tested)
data3 = FOREACH data2 GENERATE group, SUM(data1.cpc) as cost:int;
data4 = ORDER data3 BY cost ASC;
DESCRIBE data4;
this has no problem with result:
data4: {group: chararray,cost: int}
however, if I change the
DESCRIBE data4
to
DUMP data4
, it will cause error:
2014-06-11 17:22:26,525 ERROR org.apache.pig.tools.pigstats.SimplePigStats:
ERROR: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.L
ong cannot be cast to java.lang.Integer
2014-06-11 17:22:26,525 ERROR org.apache.pig.tools.pigstats.PigStatsUtil: 1
map reduce job(s) failed!
2014-06-11 17:22:26,573 ERROR org.apache.pig.tools.grunt.Grunt: ERROR 1066:
Unable to open iterator for alias data4. Backend error : java.lang.RuntimeEx
ception: java.lang.ClassCastException: java.lang.Long cannot be cast to java
.lang.Integer
I checked the data for cost field, the value each is within int range, however if I change
as cost:int
to
as cost:long
, error gone
I just can not understand how the long type is involved here
Thanks