是否为无界的PCollection定义窗口

发布于 2025-01-23 19:30:40 字数 185 浏览 3 评论 0 原文

Beam/Flink的新手,很高兴在此问题上提供帮助。 我有一个管道,可以从kafka avro消息中读取一些对象转换,然后再次写信给kafka。没有定义任何窗口,因为目前我们想在没有汇总的情况下分别处理每个事件。 我想知道这是否正确。根据我在文档中的了解,似乎我们无法使用默认行为,并定义某种窗口和相关的触发器。

我的理解正确吗? 谢谢 s

New to beam/flink and would appreciate assistance in this issue.
I have a pipeline that reads from kafka avro message does some object transformation and writes again to kafka. ו did not define any window since currently we would like to handle each event separately with no aggregation.
I wonder if this correct. From what i understand in the docs seem like we cannot use the default behaviour and define some kind of window and relevant triggers.

Is my understanding correct?
Thanks
S

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌化 2025-01-30 19:30:40

如果您没有为管道指定窗口策略,它将自动在全局窗口上运行。由于没有汇总或这样做,这还可以。
说:

所有管道默认使用GlobalWindow。这是一个覆盖整个PCollection的单个窗口。
在许多情况下,尤其是对于批处理管道,这就是我们想要的,因为我们想分析我们拥有的所有数据。

ℹ️Ablodwindow在流管线中不是很有用,除非您只需要元素转换。像GroupByKey和Combine这样的聚合需要处理整个窗口,但是流媒体管道没有结束,因此它们永远不会完成。

If you do not specify a windowing strategy for a pipeline, it will automatically run on a global window. Since no aggregations or such are to be made, this is ok.
https://colab.research.google.com/github/apache/beam/blob/master/examples/notebooks/tour-of-beam/windowing.ipynb says:

All pipelines use the GlobalWindow by default. This is a single window that covers the entire PCollection.
In many cases, especially for batch pipelines, this is what we want since we want to analyze all the data that we have.

ℹ️ GlobalWindow is not very useful in a streaming pipeline unless you only need element-wise transforms. Aggregations, like GroupByKey and Combine, need to process the entire window, but a streaming pipeline has no end, so they would never finish.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文