danny0405 commented on a change in pull request #4016:
URL: https://github.com/apache/hudi/pull/4016#discussion_r776561623
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTimelineArchiveLog.java
##########
@@ -321,10 +321,19 @@ public void archive(HoodieEngineContext context,
List<HoodieInstant> instants) t
List<IndexedRecord> records = new ArrayList<>();
for (HoodieInstant hoodieInstant : instants) {
try {
- deleteAnyLeftOverMarkers(context, hoodieInstant);
- records.add(convertToAvroRecord(hoodieInstant));
- if (records.size() >= this.config.getCommitArchivalBatchSize()) {
- writeToFile(wrapperSchema, records);
+ if (table.getActiveTimeline().isEmpty(hoodieInstant)
+ && (
+
hoodieInstant.getAction().equals(HoodieTimeline.CLEAN_ACTION)
+ ||
(hoodieInstant.getAction().equals(HoodieTimeline.ROLLBACK_ACTION) &&
hoodieInstant.isCompleted())
+ )
Review comment:
We better add a uniform util do decide what kind of instant file(action
type and state) should be non-empty.
--
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]