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 2019/12/27 19:48:27 UTC
[GitHub] [incubator-hudi] bvaradar commented on a change in pull request
#1128: [HUDI-453] Fix throw failed to archive commits error when writing
data to MOR/COW table
bvaradar commented on a change in pull request #1128: [HUDI-453] Fix throw failed to archive commits error when writing data to MOR/COW table
URL: https://github.com/apache/incubator-hudi/pull/1128#discussion_r361733653
##########
File path: hudi-client/src/main/java/org/apache/hudi/io/HoodieCommitArchiveLog.java
##########
@@ -249,6 +249,13 @@ public void archive(List<HoodieInstant> instants) throws HoodieCommitException {
LOG.info("Wrapper schema " + wrapperSchema.toString());
List<IndexedRecord> records = new ArrayList<>();
for (HoodieInstant hoodieInstant : instants) {
+
+ // filter empty instant, like *.commit.requested
+ byte[] instantDetails = commitTimeline.getInstantDetails(hoodieInstant).get();
Review comment:
@lamber-ken : Instead of blindly skipping the empty metadata, can we handle in HoodieCommitArchiveLog.convertToAvroRecord so that we still create an archived entry but with empty commitMetadata. This way, we faithfully archive all state transitions.
In other words, for the below two code snippets, if the state is Requested, skip setting commit metadata but set other attributes.
case HoodieTimeline.COMMIT_ACTION: {
HoodieCommitMetadata commitMetadata = HoodieCommitMetadata
.fromBytes(commitTimeline.getInstantDetails(hoodieInstant).get(), HoodieCommitMetadata.class);
archivedMetaWrapper.setHoodieCommitMetadata(commitMetadataConverter(commitMetadata));
archivedMetaWrapper.setActionType(ActionType.commit.name());
break;
}
case HoodieTimeline.DELTA_COMMIT_ACTION: {
HoodieCommitMetadata commitMetadata = HoodieCommitMetadata
.fromBytes(commitTimeline.getInstantDetails(hoodieInstant).get(), HoodieCommitMetadata.class);
archivedMetaWrapper.setHoodieCommitMetadata(commitMetadataConverter(commitMetadata));
archivedMetaWrapper.setActionType(ActionType.commit.name());
break;
}
----------------------------------------------------------------
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
With regards,
Apache Git Services