1
0

[HUDI-3583] Fix MarkerBasedRollbackStrategy NoSuchElementException (#4984)

Co-authored-by: Y Ethan Guo <ethan.guoyihua@gmail.com>
This commit is contained in:
liujinhui
2022-03-13 15:00:50 +08:00
committed by GitHub
parent eee96e9af3
commit e60acc1258
2 changed files with 28 additions and 9 deletions

View File

@@ -80,6 +80,20 @@ public class TestMarkerBasedRollbackStrategy extends HoodieClientTestBase {
cleanupResources();
}
@Test
public void testMarkerBasedRollbackAppend() throws Exception {
HoodieTestTable testTable = HoodieTestTable.of(metaClient);
String f0 = testTable.addRequestedCommit("000")
.getFileIdsWithBaseFilesInPartitions("partA").get("partA");
testTable.forCommit("001")
.withMarkerFile("partA", f0, IOType.APPEND);
HoodieTable hoodieTable = HoodieSparkTable.create(getConfig(), context, metaClient);
List<HoodieRollbackRequest> rollbackRequests = new MarkerBasedRollbackStrategy(hoodieTable, context, getConfig(),
"002").getRollbackRequests(new HoodieInstant(HoodieInstant.State.INFLIGHT, HoodieTimeline.COMMIT_ACTION, "001"));
assertEquals(1, rollbackRequests.size());
}
@Test
public void testCopyOnWriteRollbackWithTestTable() throws Exception {
// given: wrote some base files and corresponding markers