Click to copy
Tables • Reviewed for ksqlDB 0.29
How to Delete Row from Table in ksqlDB
DELETE
statements don’t exist in ksqlDB. Instead, you need to use tombstones.
A tombstone is a record whose message value is set to NULL
, and the message key is set to the value of the record we want to flag as deleted.
When ksqlDB receives a tombstone in a table, it will delete any existing record with that key.
Although it’s a recognized pattern used by ksqlDB, inserting a tombstone into a table is not straightforward.
The main issue of inserting a NULL
value to a table is its schema. Any table will have multiple fields that map into a nested structure by default so you can’t simply run an insert statement setting its message value to null.
Was this article helpful?