0

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?

Kubus
  • 677
  • 6
  • 18

1 Answers1

0

I found this issue on GitHub, so I tried the recently released version 0.15.0 and it works. So it seems it is a bug in v0.14.0.

Kubus
  • 677
  • 6
  • 18