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


##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/MetadataConversionUtils.java:
##########
@@ -186,8 +188,9 @@ public static HoodieArchivedMetaEntry createMetaWrapper(
         break;
       }
       case HoodieTimeline.COMMIT_ACTION: {
-        getCommitMetadata(metaClient, hoodieInstant, 
HoodieCommitMetadata.class)
-            .ifPresent(commitMetadata -> 
archivedMetaWrapper.setHoodieCommitMetadata(convertCommitMetadataToAvro(commitMetadata)));
+        HoodieCommitMetadata commitMetadata = 
metaClient.getCommitMetadataSerDe().deserialize(hoodieInstant, new 
ByteArrayInputStream(instantDetails.get()),

Review Comment:
   for deserialization, please use readInstantContent of HoodieTimeline class. 
Never use SerDe class outside HoodieTimeline class internal implementation as 
we provide readInstantContent API.
   
   If we read from the wrong timeline (active as opposed to archival), we 
should call that API over the right HoodieTimeline subclass. The implementation 
of getCommitMetadata uses active timeline. If we want to read from archival, 
please get an archival timeline and call properly API.
   
   Please ensure we have test coverage validating the fix.



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