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 2019/12/02 19:26:37 UTC

[GitHub] [incubator-hudi] bvaradar commented on a change in pull request #1062: [HUDI-294] Delete Paths written in Cleaner plan needs to be relative to partition-path

bvaradar commented on a change in pull request #1062: [HUDI-294] Delete Paths written in Cleaner plan needs to be relative to partition-path
URL: https://github.com/apache/incubator-hudi/pull/1062#discussion_r352763966
 
 

 ##########
 File path: hudi-client/src/test/java/org/apache/hudi/TestCleaner.java
 ##########
 @@ -597,6 +600,103 @@ public void testKeepLatestFileVersionsMOR() throws IOException {
         file2P0L0, Option.of(2)));
   }
 
+  @Test
+  public void testUpgradeDowngrade() {
+    String commitTime = "000";
+
+    String partition1 = DEFAULT_PARTITION_PATHS[0];
+    String partition2 = DEFAULT_PARTITION_PATHS[1];
+
+    String fileName1 = "data1_1_000.parquet";
+    String fileName2 = "data2_1_000.parquet";
+
+    String filePath1 = metaClient.getBasePath() + "/" + partition1 + "/" + fileName1;
+    String filePath2 = metaClient.getBasePath() + "/" + partition1 + "/" + fileName2;
+
+    List<String> deletePathPatterns1 = Arrays.asList(filePath1, filePath2);
+    List<String> successDeleteFiles1 = Arrays.asList(filePath1);
+    List<String> failedDeleteFiles1 = Arrays.asList(filePath2);
+
+    // create partition1 clean stat.
+    HoodieCleanStat cleanStat1 = new HoodieCleanStat(HoodieCleaningPolicy.KEEP_LATEST_FILE_VERSIONS,
+        partition1, deletePathPatterns1, successDeleteFiles1,
+        failedDeleteFiles1, commitTime);
+
+    List<String> deletePathPatterns2 = new ArrayList<>();
+    List<String> successDeleteFiles2 = new ArrayList<>();
+    List<String> failedDeleteFiles2 = new ArrayList<>();
+
+    // create partition2 empty clean stat.
+    HoodieCleanStat cleanStat2 = new HoodieCleanStat(HoodieCleaningPolicy.KEEP_LATEST_COMMITS,
+        partition2, deletePathPatterns2, successDeleteFiles2,
+        failedDeleteFiles2, commitTime);
+
+    // map with absolutely file path.
+    Map<String, List<List<String>>> oldExpected = new HashMap<>();
+    oldExpected.put(partition1, Arrays.asList(deletePathPatterns1, successDeleteFiles1, failedDeleteFiles1));
 
 Review comment:
   Arrays.asList(deletePathPatterns1, successDeleteFiles1, failedDeleteFiles1) 
   
     As there is always going to be 3 entries, would Tuple type be a good alternative to using List 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services