Reputation: 273
I am using Kafka REST API issued from curl POST to ksql If I do not use LIMIT20, it hangs. Also If I use it to query on a table again it hangs. I am running this from inside a python script Here I am querying from in between rowtime bcoz I can't get latest results from a stream as it is continuous and persistent.
data = {"ksql":"SELECT MAX(ROWTIME),TIMESTAMPTOSTRING(ROWTIME, 'yyyy-MM-dd HH:mm:ss'),MYFIRMWAREVERSION,MYBASEMACID,BOOTTS,IMEI,PRODDEVICESERIALNUM,RESETREASON FROM NOV_STREAM WHERE TIMESTAMPTOSTRING(ROWTIME, 'yyyy-MM-dd HH:mm:ss') >= '2018-12-11 00:29:30'AND TIMESTAMPTOSTRING(ROWTIME, 'yyyy-MM-dd HH:mm:ss') <= '2018-12-11 23:29:30' GROUP BY ROWTIME,MYFIRMWAREVERSION,MYBASEMACID,BOOTTS,IMEI,PRODDEVICESERIALNUM,RESETREASON LIMIT 20;","streamsProperties":{"ksql.streams.auto.offset.reset": "earliest","format": "json"}}
Upvotes: 2
Views: 900
Reputation: 15077
This is expected. A KSQL query, unless you use LIMIT
, is a continuous streaming query. That is, it will -- by design -- not terminate by itself. This is the case for both streams and tables.
For tables, the query continues to run and will show you any subsequent updates to the table in its query output.
Upvotes: 8