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 2021/08/11 00:07:34 UTC

[GitHub] [hudi] satishkotha commented on a change in pull request #3310: [HUDI-1518] Remove the logic that delete replaced file when archive

satishkotha commented on a change in pull request #3310:
URL: https://github.com/apache/hudi/pull/3310#discussion_r686397627



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTimelineArchiveLog.java
##########
@@ -331,29 +323,6 @@ private void deleteAnyLeftOverMarkerFiles(HoodieEngineContext context, HoodieIns
     }
   }
 
-  private boolean deleteReplacedFileGroups(HoodieEngineContext context, HoodieInstant instant) {
-    if (!instant.isCompleted() || !HoodieTimeline.REPLACE_COMMIT_ACTION.equals(instant.getAction())) {
-      // only delete files for completed replace instants
-      return true;
-    }
-
-    TableFileSystemView fileSystemView = this.table.getFileSystemView();
-    List<String> replacedPartitions = getReplacedPartitions(instant);
-    return ReplaceArchivalHelper.deleteReplacedFileGroups(context, metaClient, fileSystemView, instant, replacedPartitions);

Review comment:
       Do we need ReplaceArchivalHelper class? 

##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/io/TestHoodieTimelineArchiveLog.java
##########
@@ -233,45 +231,6 @@ public void testArchiveTableWithArchival() throws IOException {
     verifyInflightInstants(metaClient, 2);
   }
 
-  @Test
-  public void testArchiveTableWithReplacedFiles() throws Exception {
-    HoodieTestUtils.init(hadoopConf, basePath);
-    HoodieWriteConfig cfg = HoodieWriteConfig.newBuilder().withPath(basePath)
-        .withSchema(HoodieTestDataGenerator.TRIP_EXAMPLE_SCHEMA).withParallelism(2, 2).forTable("test-trip-table")
-        .withCompactionConfig(HoodieCompactionConfig.newBuilder().retainCommits(1).archiveCommitsWith(2, 3).build())
-        .build();
-
-    // when using insert_overwrite or insert_overwrite_table
-    // first commit may without replaceFileIds
-    createReplaceMetadataWithoutReplaceFileId("000");

Review comment:
       Could we also remove these helper methods?




-- 
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