danny0405 commented on code in PR #18016:
URL: https://github.com/apache/hudi/pull/18016#discussion_r2762018830
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanner.java:
##########
@@ -241,6 +243,17 @@ private Stream<String>
getPartitionsForInstants(HoodieInstant instant) {
} else {
HoodieCommitMetadata commitMetadata =
hoodieTable.getActiveTimeline().readCommitMetadata(instant);
+ WriteOperationType operationType = commitMetadata.getOperationType();
+ if ((HoodieTimeline.COMMIT_ACTION.equals(instant.getAction()) &&
hoodieTable.getMetaClient().getTableType().equals(
+ HoodieTableType.COPY_ON_WRITE)) ||
(HoodieTimeline.DELTA_COMMIT_ACTION.equals(instant.getAction()) &&
hoodieTable.getMetaClient().getTableType().equals(
+ HoodieTableType.MERGE_ON_READ))) {
+ if (WriteOperationType.isUpsert(operationType) ||
WriteOperationType.isInsertWithoutReplace(operationType)) {
Review Comment:
for this case
`(HoodieTimeline.DELTA_COMMIT_ACTION.equals(instant.getAction()) &&
hoodieTable.getMetaClient().getTableType().equals(
HoodieTableType.MERGE_ON_READ)`, we can skip the partition it
writes into directly? For mor, it either writes into a new file group or add
logs to existing file group, both do not need cleaning.
--
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]