# Sink from tables with no primary key

**URL:** <https://forum.confluent.io/t/sink-from-tables-with-no-primary-key/7469>\
**Category:** Self-Managed Connectors\
**Created:** [23 March 2023 12:27 UTC](https://forum.confluent.io/t/sink-from-tables-with-no-primary-key/7469 "2023-03-23T12:27:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.confluent.io/u/jaydee)\
**Post date:** [23 March 2023 12:27 UTC](https://forum.confluent.io/t/sink-from-tables-with-no-primary-key/7469/1 "2023-03-23T12:27:14Z")

</div>

I am sinking data from a table with no primary key. I am getting this error below.  
Any ideas to resolve it.  
Caused by: org.apache.kafka.connect.errors.ConnectException: Sink connector ‘jdbc-debe-azure-sink-itemdata’ is configured with ‘delete.enabled=false’ and ‘pk.mode=record\_value’ and therefore requires records with a non-null Struct value and non-null Struct schema, but found record at (topic=‘itemdata’,partition=0,offset=280,timestamp=1679535912437) with a null value and null value schema.

---

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.confluent.io/u/jaydee)\
**Post date:** [24 March 2023 13:37 UTC](https://forum.confluent.io/t/sink-from-tables-with-no-primary-key/7469/2 "2023-03-24T13:37:21Z")

</div>

Please does anyone know what I need to do to fix this error. I am still getting same error

Caused by: org.apache.kafka.connect.errors.ConnectException: Sink connector ‘jdbc-debe-azure-sink-wflog-1’ is configured with ‘delete.enabled=true’ and ‘pk.mode=record\_key’ and therefore requires records with a non-null key and non-null Struct or primitive key schema, but found record at (topic=‘wflog’,partition=5,offset=32,timestamp=1679664389234) with a null key and null key schema.

---

<div class="post-metadata">

**Author:** ![jdarrahSNT](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/jdarrahsnt/32/2816_2.png) [@jdarrahSNT](https://forum.confluent.io/u/jdarrahSNT)\
**Post date:** [29 March 2023 20:14 UTC](https://forum.confluent.io/t/sink-from-tables-with-no-primary-key/7469/3 "2023-03-29T20:14:36Z")

</div>

It looks like in one of your errors you are using record\_value and in one record\_key but both will have the same problem since you presumably don’t have a key to begin with on a table without a PK.

I suspect your problem is the tombstone records so you will need to drop tombstone records or change tombstone handling to ignore with a SMT, Here is how you would do it with confluents SMT:  
“transforms”: “ignoreTS”  
“transforms.ignoreTS.type”: “io.confluent.connect.transforms.TombstoneHandler”,  
“transforms.ignoreTS.behavior”: “ignore”,
