MAPReducer Driver运行报错Exception in thread "main" java.lang.RuntimeException: com.aliyun.odps.OdpsException: java.lang.ClassCastException: com.aliyun.odps.io.DoubleWritable cannot be cast to com.aliyun.odps.io.LongWritable-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

MAPReducer Driver运行报错Exception in thread "main" java.lang.RuntimeException: com.aliyun.odps.OdpsException: java.lang.ClassCastException: com.aliyun.odps.io.DoubleWritable cannot be cast to com.aliyun.odps.io.LongWritable

hjkhjk 2019-01-23 14:33:19 3877

我是照着海量电力设备监测数据存储分析里面的海量电力设备监测数据存储分析实验步骤来的,代码这些都是和教程里面是一样的,在用eclipse运行TJDriver时候报错。
Exception in thread "main" java.lang.RuntimeException: com.aliyun.odps.OdpsException: java.lang.ClassCastException: com.aliyun.odps.io.DoubleWritable cannot be cast to com.aliyun.odps.io.LongWritable

at com.aliyun.odps.mapred.LocalJobRunner.submit(LocalJobRunner.java:163)
at com.aliyun.odps.mapred.JobClient.submitJob(JobClient.java:178)
at com.aliyun.odps.mapred.JobClient.runJob(JobClient.java:80)
at TJDriver.main(TJDriver.java:36)

Caused by: com.aliyun.odps.OdpsException: java.lang.ClassCastException: com.aliyun.odps.io.DoubleWritable cannot be cast to com.aliyun.odps.io.LongWritable

at com.aliyun.odps.mapred.LocalJobRunner.runJob(LocalJobRunner.java:206)
at com.aliyun.odps.mapred.LocalJobRunner.submit(LocalJobRunner.java:160)
... 3 more

Caused by: java.lang.ClassCastException: com.aliyun.odps.io.DoubleWritable cannot be cast to com.aliyun.odps.io.LongWritable

at com.aliyun.odps.mapred.bridge.WritableRecord.getBigint(WritableRecord.java:213)
at com.aliyun.odps.mapred.bridge.WritableRecord.getBigint(WritableRecord.java:223)
at TJReducer.reduce(TJReducer.java:57)
at com.aliyun.odps.mapred.local.ReduceDriver.run(ReduceDriver.java:232)
at com.aliyun.odps.mapred.LocalJobRunner.handleNonPipeMode(LocalJobRunner.java:371)
at com.aliyun.odps.mapred.LocalJobRunner.runJob(LocalJobRunner.java:203)
... 4 more
存储 Android开发
分享到
取消 提交回答
全部回答(1)
  • hjkhjk
    2019-07-17 23:26:37
    已采纳

    格式转换出错,看一下格式出错的位置换成getDouble就行了

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程