[英]KSQL UNIX_TIMESTAMP function is not dinamic on streams created with queries
I'm creating the following stream:我正在创建以下 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;
当我执行命令时: 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.它仅显示发布日期小于创建库存 stream 时刻的消息。
How can I force the unix_timestamp value to update and update my stream inventory?如何强制 unix_timestamp 值更新和更新我的 stream 库存?
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如果您希望消息少于“现在”,则需要将其包含为您运行的每个 SELECT 查询的 WHERE 子句
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.