Kafka Confluent: delete mode in JDBC sink connector is giving error and not able to use composite key in `pk.fields`

纵饮孤独 提交于 2020-05-16 05:44:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!