@@ -49,6 +49,7 @@ public class ClickHouseSinkConfig {
49
49
public static final String DATE_TIME_FORMAT = "dateTimeFormats" ;
50
50
public static final String TOLERATE_STATE_MISMATCH = "tolerateStateMismatch" ;
51
51
public static final String BYPASS_SCHEMA_VALIDATION = "bypassSchemaValidation" ;
52
+ public static final String BYPASS_FIELD_CLEANUP = "bypassFieldCleanup" ;
52
53
53
54
public static final int MILLI_IN_A_SEC = 1000 ;
54
55
private static final String databaseDefault = "default" ;
@@ -90,6 +91,7 @@ public class ClickHouseSinkConfig {
90
91
private final String clientVersion ;
91
92
private final boolean tolerateStateMismatch ;
92
93
private final boolean bypassSchemaValidation ;
94
+ private final boolean bypassFieldCleanup ;
93
95
94
96
public enum InsertFormats {
95
97
NONE ,
@@ -263,6 +265,7 @@ public ClickHouseSinkConfig(Map<String, String> props) {
263
265
this .clientVersion = props .getOrDefault (CLIENT_VERSION , "V1" );
264
266
this .tolerateStateMismatch = Boolean .parseBoolean (props .getOrDefault (TOLERATE_STATE_MISMATCH , "false" ));
265
267
this .bypassSchemaValidation = Boolean .parseBoolean (props .getOrDefault (BYPASS_SCHEMA_VALIDATION , "false" ));
268
+ this .bypassFieldCleanup = Boolean .parseBoolean (props .getOrDefault (BYPASS_FIELD_CLEANUP , "false" ));
266
269
267
270
LOGGER .debug ("ClickHouseSinkConfig: hostname: {}, port: {}, database: {}, username: {}, sslEnabled: {}, timeout: {}, retry: {}, exactlyOnce: {}" ,
268
271
hostname , port , database , username , sslEnabled , timeout , retry , exactlyOnce );
@@ -285,6 +288,7 @@ public void addClickHouseSetting(String key, String value, boolean override) {
285
288
private static ConfigDef createConfigDef () {
286
289
ConfigDef configDef = new ConfigDef ();
287
290
291
+ //TODO: At some point we should group these more clearly
288
292
String group = "Connection" ;
289
293
int orderInGroup = 0 ;
290
294
configDef .define (HOSTNAME ,
@@ -568,6 +572,26 @@ private static ConfigDef createConfigDef() {
568
572
ConfigDef .Width .SHORT ,
569
573
"Tolerate state mismatch."
570
574
);
575
+ configDef .define (BYPASS_SCHEMA_VALIDATION ,
576
+ ConfigDef .Type .BOOLEAN ,
577
+ false ,
578
+ ConfigDef .Importance .LOW ,
579
+ "Bypass schema validation. default: false" ,
580
+ group ,
581
+ ++orderInGroup ,
582
+ ConfigDef .Width .SHORT ,
583
+ "Bypass schema validation."
584
+ );
585
+ configDef .define (BYPASS_FIELD_CLEANUP ,
586
+ ConfigDef .Type .BOOLEAN ,
587
+ false ,
588
+ ConfigDef .Importance .LOW ,
589
+ "Bypass field cleanup. default: false" ,
590
+ group ,
591
+ ++orderInGroup ,
592
+ ConfigDef .Width .SHORT ,
593
+ "Bypass field cleanup."
594
+ );
571
595
return configDef ;
572
596
}
573
597
}
0 commit comments