[MINOR] refactor code in HoodieMergeHandle (#2272)
This commit is contained in:
@@ -241,14 +241,11 @@ public class HoodieMergeHandle<T extends HoodieRecordPayload, I, K, O> extends H
|
|||||||
|
|
||||||
if (copyOldRecord) {
|
if (copyOldRecord) {
|
||||||
// this should work as it is, since this is an existing record
|
// 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 {
|
try {
|
||||||
fileWriter.writeAvro(key, oldRecord);
|
fileWriter.writeAvro(key, oldRecord);
|
||||||
} catch (ClassCastException e) {
|
|
||||||
LOG.debug("Old record is " + oldRecord);
|
|
||||||
throw new HoodieUpsertException(errMsg, e);
|
|
||||||
} catch (IOException | RuntimeException 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);
|
LOG.debug("Old record is " + oldRecord);
|
||||||
throw new HoodieUpsertException(errMsg, e);
|
throw new HoodieUpsertException(errMsg, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user