HBASE-20295 fix NullPointException in TableOutputFormat.checkOutputSpecs
Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
parent
cbd8b15e6b
commit
53b4507c79
|
@ -174,9 +174,13 @@ implements Configurable {
|
|||
@Override
|
||||
public void checkOutputSpecs(JobContext context) throws IOException,
|
||||
InterruptedException {
|
||||
Configuration hConf = context.getConfiguration();
|
||||
if (hConf == null) {
|
||||
hConf = this.conf;
|
||||
}
|
||||
|
||||
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());
|
||||
|
|
Loading…
Reference in New Issue