Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose scrub.invalid.names config to scrub invalid schema names #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ public class StorageSinkConnectorConfig extends AbstractConfig implements Compos
public static final int SCHEMA_CACHE_SIZE_DEFAULT = 1000;
public static final String SCHEMA_CACHE_SIZE_DISPLAY = "Schema Cache Size";

public static final String SCRUB_INVALID_NAMES_CONFIG = AvroDataConfig.SCRUB_INVALID_NAMES_CONFIG;
public static final String SCRUB_INVALID_NAMES_DOC = "Enable scrubbing of invalid schema names";
public static final String SCRUB_INVALID_NAMES_DEFAULT = false;
public static final String SCRUB_INVALID_NAMES_DISPLAY = "Scrub Invalid Schema Names";

public static final String ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG = "enhanced.avro.schema.support";
public static final boolean ENHANCED_AVRO_SCHEMA_SUPPORT_DEFAULT = true;
public static final String ENHANCED_AVRO_SCHEMA_SUPPORT_DOC =
Expand Down Expand Up @@ -243,6 +248,18 @@ public static ConfigDef newConfigDef(
CONNECT_META_DATA_DISPLAY
);

configDef.define(
SCRUB_INVALID_NAMES_CONFIG,
Type.BOOLEAN,
SCRUB_INVALID_NAMES_DEFAULT,
Importance.LOW,
SCRUB_INVALID_NAMES_DOC,
group,
++orderInGroup,
Width.SHORT,
SCRUB_INVALID_NAMES_DISPLAY
);

configDef.define(
RETRY_BACKOFF_CONFIG,
Type.LONG,
Expand Down Expand Up @@ -409,6 +426,7 @@ public AvroDataConfig avroDataConfig() {
props.put(SCHEMA_CACHE_SIZE_CONFIG, get(SCHEMA_CACHE_SIZE_CONFIG));
props.put(ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG, get(ENHANCED_AVRO_SCHEMA_SUPPORT_CONFIG));
props.put(CONNECT_META_DATA_CONFIG, get(CONNECT_META_DATA_CONFIG));
props.put(SCRUB_INVALID_NAMES_CONFIG, get(SCRUB_INVALID_NAMES_CONFIG));
return new AvroDataConfig(props);
}
}