练习mapreduce的案例出现错误Job job_local2058909726_0001 failed with state FAILED due to: NA

在练习mapreduce自定义inputformat的案例时出现以下错误:
2020-03-06 14:20:21,068 INFO [org.apache.hadoop.mapreduce.Job] - Job job_local2058909726_0001 running in uber mode : false
2020-03-06 14:20:21,068 INFO [org.apache.hadoop.mapreduce.Job] - map 0% reduce 0%
2020-03-06 14:20:21,069 INFO [org.apache.hadoop.mapreduce.Job] - Job job_local2058909726_0001 failed with state FAILED due to: NA
2020-03-06 14:20:21,070 INFO [org.apache.hadoop.mapreduce.Job] - Counters: 0
上网搜了一下发现没有相关内容,特此记录
错误原因很简单,我逐行和范例程序对照,发现是编码手误,见下面的注释。建议找不到问题出在哪里时可以和范例代码对照排查

public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException {
// 初始化
this.split = (FileSplit) split;
configuration = context.getConfiguration(); //这里出现过bug configuration 多加了 Configuration
}
大家可以看一下尚硅谷B站里Hadoop教程(hadoop框架精讲),第146个视频,里面正好把我遇到的问题讲了一遍

你可能感兴趣的:(练习mapreduce的案例出现错误Job job_local2058909726_0001 failed with state FAILED due to: NA)