Is there a workaround for the error "KSQL does not support persistent queries on windowed tables."?

37 Views Asked by At

I have a topic, filled with data about user changes on wikipedia articles. The data is in a format such as "{"user": "name", "title": "title"}".

I've created the following stream:

CREATE STREAM amazon_changes (user VARCHAR KEY, title VARCHAR) 
WITH (KAFKA_TOPIC = 'amazon', VALUE_FORMAT = 'JSON', PARTITIONS = 1);

And this table:

CREATE TABLE amazon_user_changes AS SELECT
user,
COUNT(*) AS count
FROM amazon_changes
WINDOW TUMBLING (SIZE 1 MINUTES)
GROUP BY user
EMIT CHANGES;

Now I've tried to create a new stream which will output the results of the "amazon_user_changes" into a new topic called "latest_amazon_changes_output":

CREATE STREAM amazon_changes_output
WITH (KAFKA_TOPIC = 'amazon_changes_output', VALUE_FORMAT = 'JSON')
AS
SELECT *
FROM amazon_user_changes
EMIT CHANGES;

This doesn't work, because it seems like I can't create a persistent querie on a windowed table. How can I export the results of the windowed table into a new topic?

0

There are 0 best solutions below