You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ch...@apache.org on 2013/01/31 00:56:20 UTC

git commit: SQOOP-854: Return value of pg_bulkload utility is being ignored

Updated Branches:
  refs/heads/trunk 9de589e83 -> 144d31e62


SQOOP-854: Return value of pg_bulkload utility is being ignored

(Jarek Jarcec Cecho via Cheolsoo Park)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/144d31e6
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/144d31e6
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/144d31e6

Branch: refs/heads/trunk
Commit: 144d31e62a4ca94b4db0cfefaabd736fbe13c1cf
Parents: 9de589e
Author: Cheolsoo Park <ch...@apache.org>
Authored: Wed Jan 30 15:55:26 2013 -0800
Committer: Cheolsoo Park <ch...@apache.org>
Committed: Wed Jan 30 15:55:26 2013 -0800

----------------------------------------------------------------------
 .../sqoop/mapreduce/PGBulkloadExportMapper.java    |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/144d31e6/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java b/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java
index 14d064a..5ba2b6b 100644
--- a/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java
+++ b/src/java/org/apache/sqoop/mapreduce/PGBulkloadExportMapper.java
@@ -206,11 +206,16 @@ public class PGBulkloadExportMapper
       thread.join();
     } finally {
       // block until the process is done.
-      int result = 0;
       if (null != process) {
         while (true) {
           try {
-            result = process.waitFor();
+            int returnValue = process.waitFor();
+
+            // Check pg_bulkload's process return value
+            if (returnValue != 0) {
+              throw new RuntimeException(
+                "Unexpected return value from pg_bulkload: "+ returnValue);
+            }
           } catch (InterruptedException ie) {
             // interrupted; loop around.
             continue;