[
https://issues.apache.org/jira/browse/MAPREDUCE-7368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ayush Saxena resolved MAPREDUCE-7368.
-------------------------------------
Fix Version/s: 3.4.0
Resolution: Fixed
> DBOutputFormat.DBRecordWriter#write must throw exception when it fails
> ----------------------------------------------------------------------
>
> Key: MAPREDUCE-7368
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-7368
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Affects Versions: 3.3.1
> Reporter: Stamatis Zampetakis
> Assignee: Stamatis Zampetakis
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.4.0
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> When the
> [DBRecordWriter#write|https://github.com/apache/hadoop/blob/91af256a5b44925e5dfdf333293251a19685ba2a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/db/DBOutputFormat.java#L120]
> fails with an {{SQLException}} the problem is not propagated but printed in
> {{System.err}} instead.
> {code:java}
> public void write(K key, V value) throws IOException {
> try {
> key.write(statement);
> statement.addBatch();
> } catch (SQLException e) {
> e.printStackTrace();
> }
> }
> {code}
> The consumer of this API has no way to tell that the write failed. Moreover,
> the exception is not present in the logs which makes the problem very hard
> debug and can easily lead to data corruption since clients can easily assume
> that everything went well.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]