diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java index 443d4b2d97c2..9528546a76ca 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java @@ -173,9 +173,13 @@ public RecordWriter getRecordWriter(TaskAttemptContext context) @Override public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException { + Configuration hConf = getConf(); + if (hConf == null) { + hConf = context.getConfiguration(); + } - try (Admin admin = ConnectionFactory.createConnection(getConf()).getAdmin()) { - TableName tableName = TableName.valueOf(this.conf.get(OUTPUT_TABLE)); + try (Admin admin = ConnectionFactory.createConnection(hConf).getAdmin()) { + TableName tableName = TableName.valueOf(hConf.get(OUTPUT_TABLE)); if (!admin.tableExists(tableName)) { throw new TableNotFoundException("Can't write, table does not exist:" + tableName.getNameAsString());