Davis-Zhang-Onehouse commented on code in PR #12826:
URL: https://github.com/apache/hudi/pull/12826#discussion_r1964108774


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/MetadataConversionUtils.java:
##########
@@ -378,6 +394,19 @@ private static 
org.apache.hudi.avro.model.HoodieReplaceCommitMetadata convertRep
     return JsonUtils.getObjectMapper().convertValue(replaceCommitMetadata, 
org.apache.hudi.avro.model.HoodieReplaceCommitMetadata.class);
   }
 
+  /**
+   * Convert replacecommit metadata from json to avro.
+   */
+  public static HoodieReplaceCommitMetadata 
convertReplaceCommitMetadataAvroToPojo(org.apache.hudi.avro.model.HoodieReplaceCommitMetadata
 replaceCommitMetadata) {
+    if (replaceCommitMetadata.getPartitionToWriteStats() != null) {
+      replaceCommitMetadata.getPartitionToWriteStats().remove(null);
+    }
+    if (replaceCommitMetadata.getPartitionToReplaceFileIds() != null) {
+      replaceCommitMetadata.getPartitionToReplaceFileIds().remove(null);
+    }
+    return JsonUtils.getObjectMapper().convertValue(replaceCommitMetadata, 
HoodieReplaceCommitMetadata.class);
+  }
+

Review Comment:
   removed



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to