public class CanalRecordParser extends AbstractJsonRecordParser
CanalRecordParser class is responsible for parsing records from the Canal-JSON
format. Canal is a database binlog multi-platform consumer, which is used to synchronize data
across databases. This parser extracts relevant information from the Canal-JSON format and
transforms it into a list of RichCdcMultiplexRecord objects, which represent the changes
captured in the database.
The class handles different types of database operations such as INSERT, UPDATE, and DELETE,
and generates corresponding RichCdcMultiplexRecord objects for each operation.
Additionally, the parser supports schema extraction, which can be used to understand the structure of the incoming data and its corresponding field types.
rootcomputedColumns, FIELD_DATABASE, FIELD_TABLE, typeMapping| Constructor and Description |
|---|
CanalRecordParser(TypeMapping typeMapping,
List<ComputedColumn> computedColumns) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
dataField() |
List<RichCdcMultiplexRecord> |
extractRecords() |
protected Map<String,String> |
extractRowData(org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.JsonNode record,
RowType.Builder rowTypeBuilder) |
protected String |
format() |
protected boolean |
isDDL() |
protected String |
primaryField() |
checkNotNull, checkNotNull, extractPrimaryKeys, fillDefaultTypes, getAndCheck, getAndCheck, getDatabaseName, getTableName, mergeOldRecord, processRecord, setRootbuildSchema, createRecord, evalComputedColumns, flatMappublic CanalRecordParser(TypeMapping typeMapping, List<ComputedColumn> computedColumns)
protected boolean isDDL()
isDDL in class AbstractRecordParserpublic List<RichCdcMultiplexRecord> extractRecords()
extractRecords in class AbstractRecordParserprotected String primaryField()
primaryField in class AbstractJsonRecordParserprotected String dataField()
dataField in class AbstractJsonRecordParserprotected Map<String,String> extractRowData(org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.JsonNode record, RowType.Builder rowTypeBuilder)
extractRowData in class AbstractJsonRecordParserprotected String format()
format in class AbstractRecordParserCopyright © 2023–2024 The Apache Software Foundation. All rights reserved.