I’m using the JDBC Sink Connector to stream data from Oracle to PostgreSQL.
In Oracle, both the table and column names are in UPPERCASE, whereas in PostgreSQL they are in LOWERCASE. As a result, the Kafka topics are created using UPPERCASE naming (e.g., main.ADMCMP). However, during insertion into PostgreSQL, I encounter the following error:
Error during write operation. Attempting rollback. (io.confluent.connect.jdbc.sink.JdbcDbWriter:89)
io.confluent.connect.jdbc.sink.TableAlterOrCreateException: Table “SMRT-PROD”.“main”.“ADMCMP” is missing and auto-creation is disabled.
Is there any built-in functionality or available “.jar” plugin that can help automatically handle this uppercase/lowercase mismatch between Kafka topics and PostgreSQL table/column names?
Below is the configuration I’m currently using for the JDBC Sink Connector:
Yes, I’ve already gone through the official documentation thoroughly, but unfortunately, it didn’t provide a solution for this issue.
I also attempted to use the SMT “com.github.jcustenborder.kafka.connect.transform.common.ChangeTopicCase”, but since I’m using Kafka 3.7, it appears to be incompatible or not supported, and therefore didn’t work.
I tried setting “quote.sql.identifiers=ALWAYS” in the JDBC Sink Connector, but that caused the generated SQL statement to use a format like “smrt-prod.main.ADMCMP”, which resulted in a cross-database reference error on PostgreSQL.
At this point, I’m stuck with the uppercase/lowercase mismatch issue and unable to proceed with the data insertion into PostgreSQL.
I’m not seeing any other existing publicly available SMTs to change topic case. There is also the ChangeCase SMT for keys and values as well as an analogous CaseTransform SMT, though the latter is based on an even older version of Kafka Connect so if you are hitting compatibility issues with the first one you’ll likely not have success with this latter one.