简体   繁体   中英

KSQL UNIX_TIMESTAMP function is not dinamic on streams created with queries

I'm creating the following stream:

CREATE STREAM riderLocations (profileId VARCHAR, latitude DOUBLE, longitude DOUBLE, publishtime VARCHAR) 
WITH (kafka_topic='locations', value_format='json', partitions=1);

and then this other one:

CREATE STREAM INVENTORY WITH (KAFKA_TOPIC='locations_in') 
AS select * FROM riderLocations 
where STRINGTOTIMESTAMP(publishtime, 'yyyy-MM-dd HH:mm:ss.SSSZ') < UNIX_TIMESTAMP();

when I execute the command: select * from inventory emit changes;

it only presents the messages that had a publish date smaller than the moment when the inventory stream was created.

How can I force the unix_timestamp value to update and update my stream inventory?

The timestamp is evaluated at query creation time, not runtime.

If you actively want messages less than "now", you'll need to include that as a WHERE clause for each SELECT query you run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM