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);
}
Aggregations