[HUDI-2556] Tweak some default config options for flink (#3800)
* rename write.insert.drop.duplicates to write.precombine and set it as true for COW table * set index.global.enabled default as true * set compaction.target_io default as 500GB
This commit is contained in:
@@ -275,7 +275,7 @@ public class TestWriteCopyOnWrite {
|
||||
@Test
|
||||
public void testInsertDuplicates() throws Exception {
|
||||
// reset the config option
|
||||
conf.setBoolean(FlinkOptions.INSERT_DROP_DUPS, true);
|
||||
conf.setBoolean(FlinkOptions.PRE_COMBINE, true);
|
||||
funcWrapper = new StreamWriteFunctionWrapper<>(tempFile.getAbsolutePath(), conf);
|
||||
|
||||
// open the function and ingest data
|
||||
@@ -470,7 +470,7 @@ public class TestWriteCopyOnWrite {
|
||||
public void testInsertWithDeduplication() throws Exception {
|
||||
// reset the config option
|
||||
conf.setDouble(FlinkOptions.WRITE_BATCH_SIZE, 0.0008); // 839 bytes batch size
|
||||
conf.setBoolean(FlinkOptions.INSERT_DROP_DUPS, true);
|
||||
conf.setBoolean(FlinkOptions.PRE_COMBINE, true);
|
||||
funcWrapper = new StreamWriteFunctionWrapper<>(tempFile.getAbsolutePath(), conf);
|
||||
|
||||
// open the function and ingest data
|
||||
|
||||
@@ -652,7 +652,7 @@ public class HoodieDataSourceITCase extends AbstractTestBase {
|
||||
String hoodieTableDDL = sql("t1")
|
||||
.option(FlinkOptions.PATH, tempFile.getAbsolutePath())
|
||||
.option(FlinkOptions.INDEX_GLOBAL_ENABLED, true)
|
||||
.option(FlinkOptions.INSERT_DROP_DUPS, true)
|
||||
.option(FlinkOptions.PRE_COMBINE, true)
|
||||
.end();
|
||||
streamTableEnv.executeSql(hoodieTableDDL);
|
||||
|
||||
@@ -674,7 +674,7 @@ public class HoodieDataSourceITCase extends AbstractTestBase {
|
||||
String hoodieTableDDL = sql("t1")
|
||||
.option(FlinkOptions.PATH, tempFile.getAbsolutePath())
|
||||
.option(FlinkOptions.INDEX_GLOBAL_ENABLED, false)
|
||||
.option(FlinkOptions.INSERT_DROP_DUPS, true)
|
||||
.option(FlinkOptions.PRE_COMBINE, true)
|
||||
.end();
|
||||
streamTableEnv.executeSql(hoodieTableDDL);
|
||||
|
||||
|
||||
@@ -394,6 +394,21 @@ public class TestHoodieTableFactory {
|
||||
is("UTC"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSetupWriteOptionsForSink() {
|
||||
final HoodieTableSink tableSink1 =
|
||||
(HoodieTableSink) new HoodieTableFactory().createDynamicTableSink(MockContext.getInstance(this.conf));
|
||||
final Configuration conf1 = tableSink1.getConf();
|
||||
assertThat(conf1.get(FlinkOptions.PRE_COMBINE), is(true));
|
||||
|
||||
// set up operation as 'insert'
|
||||
this.conf.setString(FlinkOptions.OPERATION, "insert");
|
||||
HoodieTableSink tableSink2 =
|
||||
(HoodieTableSink) new HoodieTableFactory().createDynamicTableSink(MockContext.getInstance(this.conf));
|
||||
Configuration conf2 = tableSink2.getConf();
|
||||
assertThat(conf2.get(FlinkOptions.PRE_COMBINE), is(false));
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Inner Class
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user