How is it possible to receive tombstone values with ksqldb REST API?
Table example:
CREATE TABLE movies (
title VARCHAR PRIMARY KEY,
id INT,
release_year INT
) WITH (
KAFKA_TOPIC='movies',
PARTITIONS=1,
VALUE_FORMAT = 'JSON'
);
INSERT INTO MOVIES (ID, TITLE, RELEASE_YEAR) VALUES (48, 'Aliens', 1986);
Robin. M. posted a workaround how to insert tombstone values into a table.
The following ksql query via REST API does not receive those "deleted" values:
POST /query HTTP/1.1
Accept: application/vnd.ksql.v1+json
Content-Type: application/vnd.ksql.v1+json
{"ksql":"SELECT * FROM Movies EMIT CHANGES;","streamsProperties":{"ksql.streams.auto.offset.reset":"earliest"}}
Row insert received example:
[{"header":{"queryId":"none","schema":"`TITLE` STRING, `ID` INTEGER, `RELEASE_YEAR` INTEGER"}},
{"row":{"columns":["Die Hard",2,1998]}},
Expected response after inserting a tombstone value is a row with boolean row.tombstone property:
{"row":{"columns":["Die Hard",null,null],"tombstone":true}}
The value is not sent to the clients. Is this a bug or am I doing something wrong? In case it is possible to receive these values, can I do the same with /query-stream API?