[HUDI-2804] Add option to skip compaction instants for streaming read (#4051)
This commit is contained in:
@@ -242,6 +242,28 @@ public class HoodieDataSourceITCase extends AbstractTestBase {
|
||||
assertRowsEquals(rows, TestData.DATA_SET_SOURCE_INSERT);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStreamWriteReadSkippingCompaction() throws Exception {
|
||||
// create filesystem table named source
|
||||
String createSource = TestConfigurations.getFileSourceDDL("source");
|
||||
streamTableEnv.executeSql(createSource);
|
||||
|
||||
String hoodieTableDDL = sql("t1")
|
||||
.option(FlinkOptions.PATH, tempFile.getAbsolutePath())
|
||||
.option(FlinkOptions.TABLE_TYPE, FlinkOptions.TABLE_TYPE_MERGE_ON_READ)
|
||||
.option(FlinkOptions.READ_AS_STREAMING, true)
|
||||
.option(FlinkOptions.READ_STREAMING_SKIP_COMPACT, true)
|
||||
.option(FlinkOptions.COMPACTION_DELTA_COMMITS, 1)
|
||||
.option(FlinkOptions.COMPACTION_TASKS, 1)
|
||||
.end();
|
||||
streamTableEnv.executeSql(hoodieTableDDL);
|
||||
String insertInto = "insert into t1 select * from source";
|
||||
execInsertSql(streamTableEnv, insertInto);
|
||||
|
||||
List<Row> rows = execSelectSql(streamTableEnv, "select * from t1", 10);
|
||||
assertRowsEquals(rows, TestData.DATA_SET_SOURCE_INSERT_LATEST_COMMIT);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStreamWriteWithCleaning() {
|
||||
// create filesystem table named source
|
||||
|
||||
Reference in New Issue
Block a user