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 2022/09/15 08:42:20 UTC

[GitHub] [hudi] pratyakshsharma commented on a diff in pull request #6662: [HUDI-4832] Fix drop partition meta sync

pratyakshsharma commented on code in PR #6662:
URL: https://github.com/apache/hudi/pull/6662#discussion_r971690126


##########
hudi-sync/hudi-hive-sync/src/test/java/org/apache/hudi/hive/TestHiveSyncTool.java:
##########
@@ -88,8 +88,8 @@
 public class TestHiveSyncTool {
 
   private static final List<Object> SYNC_MODES = Arrays.asList(
-      "hiveql",
-      "hms",
+      /*"hiveql",
+      "hms",*/

Review Comment:
   Any reason for commenting these?



##########
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:
   Why are we doing getpartitionToReplaceFileIds() here? `DELETE_PARTITION` operation can occur in a normal commit other than replacecommit action or am I missing anything here?



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org