Search in sources :

Example 6 with MetadataConverter

use of com.ververica.cdc.debezium.table.MetadataConverter in project flink-cdc-connectors by ververica.

the class PostgreSQLTableSource method getScanRuntimeProvider.

@Override
public ScanRuntimeProvider getScanRuntimeProvider(ScanContext scanContext) {
    RowType physicalDataType = (RowType) physicalSchema.toPhysicalRowDataType().getLogicalType();
    MetadataConverter[] metadataConverters = getMetadataConverters();
    TypeInformation<RowData> typeInfo = scanContext.createTypeInformation(producedDataType);
    DebeziumDeserializationSchema<RowData> deserializer = RowDataDebeziumDeserializeSchema.newBuilder().setPhysicalRowType(physicalDataType).setMetadataConverters(metadataConverters).setResultTypeInfo(typeInfo).setValueValidator(new PostgresValueValidator(schemaName, tableName)).build();
    DebeziumSourceFunction<RowData> sourceFunction = PostgreSQLSource.<RowData>builder().hostname(hostname).port(port).database(database).schemaList(schemaName).tableList(schemaName + "." + tableName).username(username).password(password).decodingPluginName(pluginName).slotName(slotName).debeziumProperties(dbzProperties).deserializer(deserializer).build();
    return SourceFunctionProvider.of(sourceFunction, false);
}
Also used : RowData(org.apache.flink.table.data.RowData) MetadataConverter(com.ververica.cdc.debezium.table.MetadataConverter) RowType(org.apache.flink.table.types.logical.RowType)

Aggregations

MetadataConverter (com.ververica.cdc.debezium.table.MetadataConverter)6 RowData (org.apache.flink.table.data.RowData)6 RowType (org.apache.flink.table.types.logical.RowType)6 MongoDBSource (com.ververica.cdc.connectors.mongodb.MongoDBSource)1 MySqlSource (com.ververica.cdc.connectors.mysql.source.MySqlSource)1 OceanBaseSource (com.ververica.cdc.connectors.oceanbase.OceanBaseSource)1 OracleSource (com.ververica.cdc.connectors.oracle.OracleSource)1