1
0

[MINOR] refactor code in HoodieMergeHandle (#2272)

This commit is contained in:
leesf
2020-11-28 21:47:05 +08:00
committed by GitHub
parent 56866a11fe
commit 3d5e9fee7f

View File

@@ -241,14 +241,11 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload, I, K, O> extends H
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);
}