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/11 18:37:32 UTC

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

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



##########
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:
       We can only reuse two lines because some of the state generated (List<HoodieRecord>) is needed for subsequent operations. So i'm not inclined to add another method for this. let me know if you have strong opinion.




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