简体   繁体   English

是否可以使用输入流中的时间戳在 Flink 中创建 Tumbling Windows。 如果是,那么如何?

[英]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.

相关问题 Flink 中非 keyed 流数据如何使用 Tumbling 窗口功能? - How to use the Tumbling window function for the non keyed streaming data in Flink? 使用窗口翻转时如何从 KSQL 流中获取最后一个值 - How to get last value from a KSQL stream when using window tumbling 对于翻滚窗口,emitEarlywhenFull()的抑制如何工作? - How does the suppress with emitEarlywhenFull() for tumbling windows works? 使用翻滚窗口时如何选择时间语义的类型? - How to select the type of time semantics when working with tumbling windows? 窗口翻转在ksql中如何工作? 作为查询返回相同的结果,无论是否在ksql中使用窗口滚动 - How does window tumbling works in ksql? As query returning same result with or without using window tumbling in ksql 使用 Flink 将数据集设置为 Kafka? 是否可以 - DataSet to Kafka Using Flink? Is it possible 如何在 Flink 中获取记录的 Kafka 时间戳? - How to get Kafka timestamp for a record in Flink? Apache Flink - 将流与输入 Kafka 主题一样进行分区 - Apache Flink - Partitioning the stream equally as the input Kafka topic 将Kafka用作Flink的输入源是否会成为性能瓶颈? - Is using Kafka as an input source for Flink a performance bottleneck? Apache Flink:如何从另一个 Stream 调用一个 Stream - Apache Flink : How to Call One Stream from Another Stream
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM