Package io.debezium.schema
Class FieldNameSelector.FieldNameSanitizer<T>
- java.lang.Object
-
- io.debezium.schema.FieldNameSelector.FieldNameSanitizer<T>
-
- All Implemented Interfaces:
FieldNameSelector.FieldNamer<T>
- Enclosing class:
- FieldNameSelector
private static class FieldNameSelector.FieldNameSanitizer<T> extends Object implements FieldNameSelector.FieldNamer<T>
A field namer that replaces any characters invalid in a field with_.
-
-
Field Summary
Fields Modifier and Type Field Description private FieldNameSelector.FieldNamer<T>delegateprivate static org.slf4j.LoggerLOGGERprivate static StringNUMBER_PREFIXprivate static StringREPLACEMENT_CHAR
-
Constructor Summary
Constructors Constructor Description FieldNameSanitizer(FieldNameSelector.FieldNamer<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfieldNameFor(T column)private StringsanitizeColumnName(String columnName)Sanitize column names that are illegal in Avro Must conform to https://avro.apache.org/docs/1.7.7/spec.html#Names Legal characters are [a-zA-Z_] for the first character and [a-zA-Z0-9_] thereafter.
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
REPLACEMENT_CHAR
private static final String REPLACEMENT_CHAR
- See Also:
- Constant Field Values
-
NUMBER_PREFIX
private static final String NUMBER_PREFIX
- See Also:
- Constant Field Values
-
delegate
private final FieldNameSelector.FieldNamer<T> delegate
-
-
Constructor Detail
-
FieldNameSanitizer
public FieldNameSanitizer(FieldNameSelector.FieldNamer<T> delegate)
-
-
Method Detail
-
fieldNameFor
public String fieldNameFor(T column)
- Specified by:
fieldNameForin interfaceFieldNameSelector.FieldNamer<T>
-
sanitizeColumnName
private String sanitizeColumnName(String columnName)
Sanitize column names that are illegal in Avro Must conform to https://avro.apache.org/docs/1.7.7/spec.html#Names Legal characters are [a-zA-Z_] for the first character and [a-zA-Z0-9_] thereafter.- Parameters:
columnName- the column name name to be sanitized- Returns:
- the sanitized name.
-
-