[英]Is it possible to create Tumbling Windows in Flink using a timestamp coming in Input Stream. If yes then How?
I have been trying to use Tumbling window on a Flink-Kafka consumer.我一直在尝试在 Flink-Kafka 消费者上使用 Tumbling 窗口。 Flink will be taking input from KafkaStream in Json format :
Flink 将从 KafkaStream 以 Json 格式获取输入:
>{"eventGroup":"1121212" , "eventTime":"2020-01-02T13:43:43"}
>{"eventGroup":"1121212" , "eventTime":"2020-01-02T13:43:44"}
>{"eventGroup":"1121213" , "eventTime":"2020-01-02T13:43:48"}
I want to group this stream by eventGroup for all values of eventTime lying between say 2020-01-02T13:40:00 to 2020-01-02T13:44:59 .我想按 eventGroup 对该流进行分组,以获取介于 2020-01-02T13:40:00 到 2020-01-02T13:44:59 之间的所有 eventTime 值。 Is such functionality supported by flink Tumbling Windows ?
flink Tumbling Windows 是否支持此类功能? If yes then a Sample code / procedure will be great help.
如果是,那么示例代码/程序将有很大帮助。
Thanks in Advance.提前致谢。
Your use case is very common.您的用例很常见。 You want to add a timestamp extractor that makes the timestamp of your events known to Flink.
你想添加一个时间戳提取器,让 Flink 知道你的事件的时间戳。 If you use event time processing , your tumbling window will behave as you expect it.
如果您使用事件时间处理,您的翻滚窗口将按照您的预期运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.