зеркало из https://github.com/github/sqoop.git
SQOOP-855: pg_bulkload: NullPointerException will be thrown if user specified invalid path the binary
(Jarek Jarcec Cecho via Cheolsoo Park)
This commit is contained in:
Родитель
144d31e62a
Коммит
0488503a3a
|
@ -170,6 +170,7 @@ public class PGBulkloadExportMapper
|
|||
thread = new ReadThread(process.getErrorStream());
|
||||
thread.start();
|
||||
} catch (Exception e) {
|
||||
LOG.error("Can't start up pg_bulkload process", e);
|
||||
cleanup(context);
|
||||
doExecuteUpdate("DROP TABLE " + tmpTableName);
|
||||
throw new IOException(e);
|
||||
|
@ -200,10 +201,17 @@ public class PGBulkloadExportMapper
|
|||
LongWritable taskid =
|
||||
new LongWritable(context.getTaskAttemptID().getTaskID().getId());
|
||||
context.write(taskid, new Text(tmpTableName));
|
||||
|
||||
if (writer != null) {
|
||||
writer.close();
|
||||
}
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
try {
|
||||
if (thread != null) {
|
||||
thread.join();
|
||||
}
|
||||
} finally {
|
||||
// block until the process is done.
|
||||
if (null != process) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче