Hello,
We have a KsqlDB Table select query that we want to use in our pipeline. But the result of our select query isn’t persisted in kafka topics, so we can’t continue to the flow. We can’t find any solution in the docs and getting this error if we try to create Stream from Table:
error message : Invalid result type. Your SELECT query produces a TABLE. Please use CREATE TABLE AS SELECT statement instead
OUR TABLE CREATE QUERY (works fine, no errors occured here, we can select expected results in cli):
CREATE TABLE ISACTIVE_TABLE_TEST3 WITH (
FORMAT = 'AVRO'
) AS
SELECT AFTER->Id, LATEST_BY_OFFSET(AFTER->IsActive, 2)[1] AS Before_IsActive,
LATEST_BY_OFFSET(AFTER->IsActive, 2)[2] AS After_IsActive
FROM test_table_stream2
GROUP BY AFTER->Id;
OUR CREATE STREAM QUERY WHICH WE TRY TO PERSIST THE SELECT QUERY RESULT
CREATE STREAM IsActiveChange_Test AS
SELECT Id, AFTER_ISACTIVE FROM ISACTIVE_TABLE_TEST3
WHERE AFTER_ISACTIVE IS NOT null AND BEFORE_ISACTIVE != AFTER_ISACTIVE
EMIT CHANGES;
Is table’s usage is restricted with stream joins and CLI selects or could we create a stream with querying tables?
Thanks in advance.
Batu