t*********u 发帖数: 26311 | 1 data3 = FOREACH data2 GENERATE group, SUM(data1.cpc) as cost:int;
data4 = ORDER data3 BY cost ASC;
如果
DESCRIBE data4;
不会报错
但是换成 DUMP data4;
就报错
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
data4: {group: chararray,cost: int}
里面没有出现需要long的地方啊 | k****o 发帖数: 76 | 2 Before doing DUMP data4, mapreduce is not actually running.. "Describe"
works without mapreduce runs..
check the table for pig SUM :
http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#SUM:
SUM returns long when input is int, but you assign it to cost: int..
This is where the runtime error comes from, I believe. change to "cost: long
", or simply "cost" without type specification..
.L
【在 t*********u 的大作中提到】 : data3 = FOREACH data2 GENERATE group, SUM(data1.cpc) as cost:int; : data4 = ORDER data3 BY cost ASC; : 如果 : DESCRIBE data4; : 不会报错 : 但是换成 DUMP data4; : 就报错 : 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
| t*********u 发帖数: 26311 | 3 got it
thanks
long
【在 k****o 的大作中提到】 : Before doing DUMP data4, mapreduce is not actually running.. "Describe" : works without mapreduce runs.. : check the table for pig SUM : : http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#SUM: : SUM returns long when input is int, but you assign it to cost: int.. : This is where the runtime error comes from, I believe. change to "cost: long : ", or simply "cost" without type specification.. : : .L
| t*********u 发帖数: 26311 | 4 你的意思是 pig
相当于先编译成java
然后在执行?
long
【在 k****o 的大作中提到】 : Before doing DUMP data4, mapreduce is not actually running.. "Describe" : works without mapreduce runs.. : check the table for pig SUM : : http://pig.apache.org/docs/r0.7.0/piglatin_ref2.html#SUM: : SUM returns long when input is int, but you assign it to cost: int.. : This is where the runtime error comes from, I believe. change to "cost: long : ", or simply "cost" without type specification.. : : .L
|
|