1. Map输出类型和Reducer的输入类型对不上

注意

当Mapper的输出类型和Reducer的输出类型是一样的时候,可以仅设置Reducer的输出类型

job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);

当时当当Mapper的输出类型和Reducer的输出类型是一样的时候,除了设置Reducer的输出类型外还要显示设置Maper的数据类型,如下

job.setMapOutputKeyClass(xxx.class);
job.setMapOutputValueClass(xxx.class);

2. myMapper和myReducer类不是 static 的,这样在主方法中使用myReducer.class就有问题

相关文章:

  • 2021-11-26
  • 2021-09-05
  • 2021-10-14
  • 2022-01-22
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案