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>
delegate
private static org.slf4j.Logger
LOGGER
private static String
NUMBER_PREFIX
private static String
REPLACEMENT_CHAR
-
Constructor Summary
Constructors Constructor Description FieldNameSanitizer(FieldNameSelector.FieldNamer<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
fieldNameFor(T column)
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.
-
-
-
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:
fieldNameFor
in 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.
-
-