Click to copy

• 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.

Sending a tombstone to a table

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.

Read on how to insert a tombstone into a table.

Discover what readers are saying
topictale
Get easy to digest how-tos on ksqlDB
Sign up
Please read our Privacy Policy to understand how we protect and manage your data.
You may also like