[HUDI-1281] Add deltacommit to ActionType (#3018)
Co-authored-by: veenaypatil <vinay18.patil@gmail.com>
This commit is contained in:
@@ -119,7 +119,7 @@ public class TestMetadataConversionUtils extends HoodieCommonTestHarness {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletedCommitOrDeltaCommit() throws Exception {
|
||||
public void testCompletedCommit() throws Exception {
|
||||
String newCommitTime = HoodieTestTable.makeNewCommitTime();
|
||||
createCommitMetadata(newCommitTime);
|
||||
HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(
|
||||
@@ -128,6 +128,16 @@ public class TestMetadataConversionUtils extends HoodieCommonTestHarness {
|
||||
assertEquals(metaEntry.getHoodieCommitMetadata().getOperationType(), WriteOperationType.INSERT.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletedDeltaCommit() throws Exception {
|
||||
String newCommitTime = HoodieTestTable.makeNewCommitTime();
|
||||
createDeltaCommitMetadata(newCommitTime);
|
||||
HoodieArchivedMetaEntry metaEntry = MetadataConversionUtils.createMetaWrapper(
|
||||
new HoodieInstant(State.COMPLETED, HoodieTimeline.DELTA_COMMIT_ACTION, newCommitTime), metaClient);
|
||||
assertEquals(metaEntry.getActionState(), State.COMPLETED.toString());
|
||||
assertEquals(metaEntry.getActionType(), HoodieTimeline.DELTA_COMMIT_ACTION);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCompletedRollback() throws Exception {
|
||||
String newCommitTime = HoodieTestTable.makeNewCommitTime();
|
||||
@@ -200,6 +210,14 @@ public class TestMetadataConversionUtils extends HoodieCommonTestHarness {
|
||||
.withBaseFilesInPartition(HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH, fileId1, fileId2);
|
||||
}
|
||||
|
||||
private void createDeltaCommitMetadata(String instantTime) throws Exception {
|
||||
String fileId1 = "file-" + instantTime + "-1";
|
||||
String fileId2 = "file-" + instantTime + "-2";
|
||||
HoodieTestTable.of(metaClient)
|
||||
.addDeltaCommit(instantTime)
|
||||
.withBaseFilesInPartition(HoodieTestDataGenerator.DEFAULT_FIRST_PARTITION_PATH, fileId1, fileId2);
|
||||
}
|
||||
|
||||
private void createReplace(String instantTime, WriteOperationType writeOperationType, Boolean isClustering)
|
||||
throws Exception {
|
||||
String fileId1 = "file-1";
|
||||
|
||||
Reference in New Issue
Block a user