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.
root
computedColumns, 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, setRoot
buildSchema, createRecord, evalComputedColumns, flatMap
public CanalRecordParser(TypeMapping typeMapping, List<ComputedColumn> computedColumns)
protected boolean isDDL()
isDDL
in class AbstractRecordParser
public List<RichCdcMultiplexRecord> extractRecords()
extractRecords
in class AbstractRecordParser
protected String primaryField()
primaryField
in class AbstractJsonRecordParser
protected String dataField()
dataField
in class AbstractJsonRecordParser
protected Map<String,String> extractRowData(org.apache.paimon.shade.jackson2.com.fasterxml.jackson.databind.JsonNode record, RowType.Builder rowTypeBuilder)
extractRowData
in class AbstractJsonRecordParser
protected String format()
format
in class AbstractRecordParser
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.