public abstract class AbstractRecordParser extends Object implements org.apache.flink.api.common.functions.FlatMapFunction<CdcSourceRecord,RichCdcMultiplexRecord>
RichCdcMultiplexRecord
objects.
This abstract class defines common functionalities and fields required for parsing messages. Subclasses are expected to provide specific implementations for extracting records, validating message formats, and other format-specific operations.
Modifier and Type | Field and Description |
---|---|
protected List<ComputedColumn> |
computedColumns |
protected static String |
FIELD_DATABASE |
protected static String |
FIELD_TABLE |
protected TypeMapping |
typeMapping |
Constructor and Description |
---|
AbstractRecordParser(TypeMapping typeMapping,
List<ComputedColumn> computedColumns) |
Modifier and Type | Method and Description |
---|---|
Schema |
buildSchema(CdcSourceRecord record) |
protected RichCdcMultiplexRecord |
createRecord(RowKind rowKind,
Map<String,String> data,
List<DataField> paimonFields)
Handle case sensitivity here.
|
protected void |
evalComputedColumns(Map<String,String> rowData,
RowType.Builder rowTypeBuilder)
generate values for computed columns.
|
protected abstract List<String> |
extractPrimaryKeys() |
protected abstract List<RichCdcMultiplexRecord> |
extractRecords() |
void |
flatMap(CdcSourceRecord value,
org.apache.flink.util.Collector<RichCdcMultiplexRecord> out) |
protected abstract String |
format() |
protected abstract String |
getDatabaseName() |
protected abstract String |
getTableName() |
protected boolean |
isDDL() |
protected abstract void |
setRoot(CdcSourceRecord record) |
protected static final String FIELD_TABLE
protected static final String FIELD_DATABASE
protected final TypeMapping typeMapping
protected final List<ComputedColumn> computedColumns
public AbstractRecordParser(TypeMapping typeMapping, List<ComputedColumn> computedColumns)
@Nullable public Schema buildSchema(CdcSourceRecord record)
public void flatMap(CdcSourceRecord value, org.apache.flink.util.Collector<RichCdcMultiplexRecord> out)
flatMap
in interface org.apache.flink.api.common.functions.FlatMapFunction<CdcSourceRecord,RichCdcMultiplexRecord>
protected abstract void setRoot(CdcSourceRecord record)
protected abstract List<RichCdcMultiplexRecord> extractRecords()
protected boolean isDDL()
protected void evalComputedColumns(Map<String,String> rowData, RowType.Builder rowTypeBuilder)
protected RichCdcMultiplexRecord createRecord(RowKind rowKind, Map<String,String> data, List<DataField> paimonFields)
protected abstract String format()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.