2
votes

I am using JDBC source connector to read data from a Teradata table and push to Kafka topic . But when I am trying to use JDBC sink connector to read Kafka topic and push to Oracle table it throws the below ERROR. I am sure the error is because of the parameters pk.mode and pk.fields which I am not sure what to use.

My terradata has a primary key UserID+ DatabaseID . I have created the table in Oracle with the primay key as Userid+databaseID.

** ERROR Cannot ALTER to add missing field SinkRecordField{schema=Schema{BYTES}, 
name='CreateUID', isPrimaryKey=true}, as it is not 
optional and does not have a default value** 

Below is my sink connector-

{name=teradata_sink
connector.class=io.confluent.connect.jdbc.JdbcSinkConnector
tasks.max=1
topics=TERADATA_ACCESSRIGHTS
connection.url=
connection.user=
connection.password=
auto.create=false
table.name.format=TERADATA_ACCESSRIGHTS
pk.mode=record_value
pk.fields=USERID+DATABASEID
auto.evolve=true
insert.mode=upsert
}

Please suggest how can I use the JDBC sink connector with the given primary keys.

1
Did you solve this problem?Giorgos Myrianthous

1 Answers

1
votes

It looks like the schema of your target does not match the source. Since you have auto.evolve=true Connect tries to ALTER the target, and here it cannot for the error shown

`CreateUID`…is not optional and does not have a default value

Does that column exist in your target table as well as source?