So, I have a pretty newbie question as I am new to ksql/kafka.
I have a stream of points that leverages the default retention period of 7 days but I have an application that needs to retrieve the last N seconds of a particular point and I am trying to reduce the query time.
In an attempt to reduce query time I created a separate stream as follows:
CREATE STREAM points_recent WITH (RETENTION_MS=300000, KAFKA_TOPIC='points-recent') AS SELECT * FROM points EMIT CHANGES;
That said, when I run the following query:
SELECT TIMESTAMPTOSTRING(rowtime, 'yyyy-MM-dd HH:mm:ss.SSS'), TIMESTAMPTOSTRING(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss.SSS') from points_recent limit 1;
I see the point that I am returned is more than 10 minutes in the past. Any ideas? What am I missing?
Thanks!