0

After configuring debezium to capture events from my table T1 whenever I change a row I get a warning like the following

WARN Column 'myCol1' available in capture table not found among source table columns (io.debezium.connector.sqlserver.SqlServerChangeTablePointer)

Which causes that the data from those fields are not included inside the Kafka topic.

Said columns are using User-Defined data types like CString:varchar(30)

I've tried using a custom converter with the following method

public class CustomSqlTypeConverter  implements CustomConverter<SchemaBuilder, RelationalColumn> {
    private static final Logger LOGGER = LoggerFactory.getLogger(CustomSqlTypeConverter.class);


    @Override
    public void configure(Properties props) {

    }

    @Override
    public void converterFor(RelationalColumn column, ConverterRegistration<SchemaBuilder> registration) {
        String columnType = column.typeName().toUpperCase();
        switch (columnType) {
            case "NSTRING":
            case "CSTRING":
            case "QSTRINGDT":
            case "TCODE":
            case "TINFO":
            case "TINFO_U":
                registration.register(SchemaBuilder.string().optional(), rs -> rs.toString());
                LOGGER.info("Mapped SQL type CONTRACTNAME to String.");
                break;

        

            default:
                LOGGER.debug("No custom mapping for type: {}", columnType);
        }
       
    
        
    }


}

Also I have tried to explicitly listed the columns in the connector configuration

 "column.include.list": "dbo.table1.(pkCol|myCol1|myCol2)

I'm using SQL Server 2017 and Debezium 3.0.2 Final

6
  • What version of sql-server and debezium are you using? Commented Dec 19, 2024 at 18:26
  • @BartMcEndree added to the post Commented Dec 19, 2024 at 18:59
  • registration.register(SchemaBuilder.string().optional(), rs -> rs.toString()); wouldn't this map same name multiple times? Commented Dec 19, 2024 at 23:01
  • no, what that does is calling toString to the value of the column Commented Dec 23, 2024 at 14:47
  • @Smog were you able to find a soltuion? Commented May 20 at 8:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.