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/01/08 15:52:19 UTC

[GitHub] [hudi] lw309637554 commented on a change in pull request #2418: [HUDI-1266] Add unit test for validating replacecommit rollback

lw309637554 commented on a change in pull request #2418:
URL: https://github.com/apache/hudi/pull/2418#discussion_r554024960



##########
File path: hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/rollback/HoodieClientRollbackTestBase.java
##########
@@ -96,4 +99,61 @@ protected void twoUpsertCommitDataWithTwoPartitions(List<FileSlice> firstPartiti
       assertEquals(1, secondPartitionCommit2FileSlices.size());
     }
   }
+
+  protected void insertOverwriteCommitDataWithTwoPartitions(List<FileSlice> firstPartitionCommit2FileSlices,
+                                                            List<FileSlice> secondPartitionCommit2FileSlices,
+                                                            HoodieWriteConfig cfg,
+                                                            boolean commitSecondInsertOverwrite) throws IOException {
+    //just generate two partitions
+    dataGen = new HoodieTestDataGenerator(new String[]{DEFAULT_FIRST_PARTITION_PATH, DEFAULT_SECOND_PARTITION_PATH});
+    HoodieTestDataGenerator.writePartitionMetadata(fs, new String[]{DEFAULT_FIRST_PARTITION_PATH, DEFAULT_SECOND_PARTITION_PATH}, basePath);
+    SparkRDDWriteClient client = getHoodieWriteClient(cfg);
+    /**
+     * Write 1 (upsert)
+     */
+    String newCommitTime = "001";
+    List<HoodieRecord> records = dataGen.generateInsertsContainsAllPartitions(newCommitTime, 2);

Review comment:
       this code is the same as twoUpsertCommitDataWithTwoPartitions, can we reuse it ?




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