Jelajahi Sumber

MAPREDUCE-7368. DBOutputFormat.DBRecordWriter#write must throw exception when it fails. (#3671). Contributed by Stamatis Zampetakis.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
Stamatis Zampetakis 3 tahun lalu
induk
melakukan
bface2ac6c

+ 1 - 1
hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/db/DBOutputFormat.java

@@ -122,7 +122,7 @@ extends OutputFormat<K,V> {
         key.write(statement);
         statement.addBatch();
       } catch (SQLException e) {
-        e.printStackTrace();
+        throw new IOException("Failed to execute SQL statement for key " + key, e);
       }
     }
   }