yihua commented on code in PR #12826:
URL: https://github.com/apache/hudi/pull/12826#discussion_r1976122143
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/MetadataConversionUtils.java:
##########
@@ -332,24 +335,13 @@ public static HoodieArchivedMetaEntry
createMetaWrapperForEmptyInstant(HoodieIns
return archivedMetaWrapper;
}
- private static Option<HoodieCommitMetadata>
getInflightCommitMetadata(HoodieTableMetaClient metaClient, HoodieInstant
instant,
-
Option<byte[]> inflightContent) throws IOException {
- if (!inflightContent.isPresent() || inflightContent.get().length == 0) {
- // inflight files can be empty in some certain cases, e.g. when users
opt in clustering
+ private static <T extends HoodieCommitMetadata> Option<T>
getCommitMetadata(HoodieTableMetaClient metaClient, HoodieInstant instant,
Class<T> clazz) throws IOException {
+ T commitMetadata =
metaClient.getActiveTimeline().loadInstantContent(instant, clazz);
+ // an empty file will return the default instance with an UNKNOWN
operation type and in that case we return an empty option
+ if (commitMetadata.getOperationType() == WriteOperationType.UNKNOWN) {
Review Comment:
Sg
--
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]