voonhous commented on code in PR #19924:
URL: https://github.com/apache/hudi/pull/19924#discussion_r3996666904
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/CompactionAdminClient.java:
##########
@@ -147,7 +147,7 @@ public List<RenameOpResult>
unscheduleCompactionFileId(HoodieFileGroupId fgId, b
HoodieCompactionPlan plan =
CompactionUtils.getCompactionPlan(metaClient,
compactionOperationWithInstant.getKey());
List<HoodieCompactionOperation> newOps =
plan.getOperations().stream().filter(op ->
- (!op.getFileId().equals(fgId.getFileId())) &&
(!op.getPartitionPath().equals(fgId.getPartitionPath())))
+ !(op.getFileId().equals(fgId.getFileId()) &&
op.getPartitionPath().equals(fgId.getPartitionPath())))
Review Comment:
GitHub will not let me attach a one-click suggestion to that file, since
this PR does not touch it. Here it is as a patch instead, if it saves you the
typing:
```diff
diff --git
a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCompactionCommand.java
b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCompactionCommand.java
index 3e849367ebe0..d95d7e84ada3 100644
---
a/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCompactionCommand.java
+++
b/hudi-cli/src/test/java/org/apache/hudi/cli/commands/TestCompactionCommand.java
@@ -279,12 +279,9 @@ public class TestCompactionCommand extends
CLIFunctionalTestHarness {
if (dryRun) {
assertEquals(fileIdsBefore, fileIdsOf(PENDING_COMPACTION_INSTANT));
} else {
- // The admin client keeps the operations that differ from the
unscheduled one in file id AND
- // in partition path, so the sibling operation goes with it and the
plan is left with no
- // operations at all (https://github.com/apache/hudi/issues/19881).
When that is fixed this
- // expectation has to become the sibling on its own:
- // fileIdsBefore minus the unscheduled file id.
- assertEquals(Collections.emptySet(),
fileIdsOf(PENDING_COMPACTION_INSTANT));
+ Set<String> expected = fileIdsBefore.stream()
+ .filter(fileId ->
!fileId.equals(unscheduled.getFileId())).collect(Collectors.toSet());
+ assertEquals(expected, fileIdsOf(PENDING_COMPACTION_INSTANT));
}
}
```
--
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]