in src/main/java/org/apache/flink/connector/rocketmq/source/reader/deserializer/RowDeserializationSchema.java [79:121]
public RowDeserializationSchema(
TableSchema tableSchema,
DirtyDataStrategy formatErrorStrategy,
DirtyDataStrategy fieldMissingStrategy,
DirtyDataStrategy fieldIncrementStrategy,
String encoding,
String fieldDelimiter,
String lineDelimiter,
boolean columnErrorDebug,
boolean hasMetadata,
MetadataConverter[] metadataConverters,
List<String> headerFields,
Map<String, String> properties) {
this.tableSchema = tableSchema;
this.formatErrorStrategy = formatErrorStrategy;
this.fieldMissingStrategy = fieldMissingStrategy;
this.fieldIncrementStrategy = fieldIncrementStrategy;
this.columnErrorDebug = columnErrorDebug;
this.encoding = encoding;
this.fieldDelimiter = StringEscapeUtils.unescapeJava(fieldDelimiter);
this.lineDelimiter = StringEscapeUtils.unescapeJava(lineDelimiter);
this.metadataCollector = new MetadataCollector(hasMetadata, metadataConverters);
this.headerFields = headerFields == null ? null : new HashSet<>(headerFields);
this.properties = properties;
this.totalColumnSize = tableSchema.getFieldNames().length;
int dataColumnSize = 0;
this.fieldTypes = new ByteSerializer.ValueType[totalColumnSize];
this.columnIndexMapping = new HashMap<>();
this.dataIndexMapping = new HashMap<>();
for (int index = 0; index < totalColumnSize; index++) {
this.columnIndexMapping.put(tableSchema.getFieldNames()[index], index);
}
for (int index = 0; index < totalColumnSize; index++) {
ByteSerializer.ValueType type =
ByteSerializer.getTypeIndex(tableSchema.getFieldTypes()[index].getTypeClass());
this.fieldTypes[index] = type;
if (!isHeaderField(index)) {
dataIndexMapping.put(dataColumnSize, index);
dataColumnSize++;
}
}
this.dataColumnSize = dataColumnSize;
}