avatar
t*u
2
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的地方啊
avatar
k*o
3
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

avatar
t*u
4
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

avatar
t*u
5
你的意思是 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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。