异常信息:

Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable
MapReduce自定义InputFormat异常:Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable

异常来源:

在使用MapReduce自定义InputFormat后,运行程序抛出该异常。异常抛出后,一开始认为可能是代码中涉及类型转换出现问题。反复排查后,此可能被排除

异常分析:

以下是异常发生前书写的代码:
MapReduce自定义InputFormat异常:Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable
自定义 InputFormat,需要在调用 addInputPath() 方法配置 自定义InputFormat.class

解决方案:

调用Job实例的 setInputFormatClass() 设置自定义InputFormat.class
MapReduce自定义InputFormat异常:Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable
运行通过
MapReduce自定义InputFormat异常:Caused by: java.lang.ClassCastException: org.apache.hadoop.io.LongWritable

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-13
  • 2022-02-20
  • 2021-08-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-07-04
  • 2021-09-17
  • 2022-01-20
相关资源
相似解决方案