问题
I am having two issues.
1) I enabled the delete.enabled
as true
. But since it needs the pk.mode
to be set as record_key
I am not able to use the composite key of my MySQL table as I could use when I set pk.mode
as record_value
. I tried to add a composite key in the Stream while converting the records into AVRO format using the partition by
option. But it added a new column in the MySQL table. The row is not set if I am using a single primary key instead of a composite key.
2) The delete mode is not working in my sink connector. I used insert.mode
as upsert
. My MySQL table contains fields that have a not null
attribute. The error that is thrown: Col has a not-null attribute. It cannot be null
. For delete, I am removing all values in the record except for the primary key value. Example of a tombstone record for delete operation - ,,,,,,,,<primary key value>,,,,,,,,,
. If I am adding the values for all those columns that have the attribute as not-null
, the update operation gets executed. Also, I want to know if I am making any mistake while creating a tombstone record.
来源:https://stackoverflow.com/questions/61087098/kafka-confluent-delete-mode-in-jdbc-sink-connector-is-giving-error-and-not-able