codope commented on code in PR #6244:
URL: https://github.com/apache/hudi/pull/6244#discussion_r934137412
##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/action/rollback/TestCopyOnWriteRollbackActionExecutor.java:
##########
@@ -133,6 +148,65 @@ public void
testCopyOnWriteRollbackActionExecutorForFileListingAsGenerateFile()
assertFalse(testTable.baseFileExists(p2, "002", "id22"));
}
+ @Test
+ public void testListBasedRollbackStrategy() throws Exception {
+ //just generate two partitions
+ dataGen = new HoodieTestDataGenerator(new String[]
{DEFAULT_FIRST_PARTITION_PATH, DEFAULT_SECOND_PARTITION_PATH,
DEFAULT_THIRD_PARTITION_PATH});
+ HoodieWriteConfig cfg =
getConfigBuilder().withRollbackUsingMarkers(false).build();
+ // 1. prepare data
+ HoodieTestDataGenerator.writePartitionMetadataDeprecated(fs, new String[]
{DEFAULT_FIRST_PARTITION_PATH, DEFAULT_SECOND_PARTITION_PATH}, basePath);
+ SparkRDDWriteClient client = getHoodieWriteClient(cfg);
+ /**
+ * Write 1 (only inserts)
+ */
+ String newCommitTime = "001";
+ client.startCommitWithTime(newCommitTime);
+ List<HoodieRecord> records =
dataGen.generateInsertsContainsAllPartitions(newCommitTime, 3);
+ JavaRDD<HoodieRecord> writeRecords = jsc.parallelize(records, 1);
+ JavaRDD<WriteStatus> statuses = client.upsert(writeRecords, newCommitTime);
+ Assertions.assertNoWriteErrors(statuses.collect());
+ //client.commit(newCommitTime, statuses);
Review Comment:
let's remove this comment and on #L178 as well. let's also fix the comment
on L160 as we are doing upsert not insert.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]