Skip to content

Commit

Permalink
[MINOR] refactor code in HoodieMergeHandle
Browse files Browse the repository at this point in the history
  • Loading branch information
leesf committed Nov 27, 2020
1 parent 537502a commit 2e6ebef
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,11 @@ public void write(GenericRecord oldRecord) {

if (copyOldRecord) {
// this should work as it is, since this is an existing record
String errMsg = "Failed to merge old record into new file for key " + key + " from old file " + getOldFilePath()
+ " to new file " + newFilePath + " with writerSchema " + writerSchemaWithMetafields.toString(true);
try {
fileWriter.writeAvro(key, oldRecord);
} catch (ClassCastException e) {
LOG.debug("Old record is " + oldRecord);
throw new HoodieUpsertException(errMsg, e);
} catch (IOException | RuntimeException e) {
String errMsg = String.format("Failed to merge old record into new file for key %s from old file %s to new file %s with writerSchema %s",
key, getOldFilePath(), newFilePath, writerSchemaWithMetafields.toString(true));
LOG.debug("Old record is " + oldRecord);
throw new HoodieUpsertException(errMsg, e);
}
Expand Down

0 comments on commit 2e6ebef

Please sign in to comment.