You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/11/27 11:32:43 UTC

[GitHub] [hudi] yanghua commented on a change in pull request #2272: [MINOR] refactor code in HoodieMergeHandle

yanghua commented on a change in pull request #2272:
URL: https://github.com/apache/hudi/pull/2272#discussion_r531547424



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
##########
@@ -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 = "Failed to merge old record into new file for key " + key + " from old file " + getOldFilePath()

Review comment:
       Using `String#format` would be better?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org