codope commented on code in PR #6662:
URL: https://github.com/apache/hudi/pull/6662#discussion_r971980886
##########
hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/HoodieSyncClient.java:
##########
@@ -83,18 +87,24 @@ public boolean isBootstrap() {
return metaClient.getTableConfig().getBootstrapBasePath().isPresent();
}
- public boolean isDropPartition() {
+ /**
+ * Get the set of dropped partitions based on the latest commit metadata.
+ * Returns empty set if the latest commit was not due to DELETE_PARTITION
operation.
+ */
+ public Set<String> getDroppedPartitions() {
try {
- Option<HoodieCommitMetadata> hoodieCommitMetadata =
HoodieTableMetadataUtil.getLatestCommitMetadata(metaClient);
+ Option<HoodieCommitMetadata> hoodieCommitMetadata =
getLatestCommitMetadata(metaClient);
if (hoodieCommitMetadata.isPresent()
&&
WriteOperationType.DELETE_PARTITION.equals(hoodieCommitMetadata.get().getOperationType()))
{
- return true;
+ Map<String, List<String>> partitionToReplaceFileIds =
+ ((HoodieReplaceCommitMetadata)
hoodieCommitMetadata.get()).getPartitionToReplaceFileIds();
Review Comment:
DELETE_PARTITION operation adds a replacecommit action in the timeline. The
partitions which get deleted are contained in `partitionToReplaceFileIds `.
--
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]