根据Kafka -Apache Flink中的路径读取S3文件

发布于 2025-01-27 04:10:22 字数 118 浏览 2 评论 0原文

我有一个管道,可以听到一个接收S3文件名的Kafka主题&小路。管道必须从S3读取文件,并进行一些转换&聚合。 我看到Flink具有直接读取S3文件作为源连接器的支持,但是此用例是作为转换阶段的一部分读取。

I have a pipeline that listens to a Kafka topic that receives the s3 file-name & path. The pipeline has to read the file from S3 and do some transformation & aggregation.
I see the Flink has support to read the S3 file directly as source connector, but this use case is to read as part of the transformation stage.

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

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

发布评论

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

评论(1

只有一腔孤勇 2025-02-03 04:10:22

我不认为这是可能的。

另一种选择是保持flink会话集群运行,并在批处理模式下动态创建并提交新的Flink SQL作业以处理每个文件的摄入。

您可能会吸引您的另一种方法是实现一种接受路径作为输入,读取文件并逐一发射记录的RichFlatMapfunction。但是,除非文件很小,否则这可能不是很好,因为Flink确实不喜欢拥有长时间运行的用户功能。

I don't believe this is currently possible.

An alternative might be to keep a Flink session cluster running, and dynamically create and submit a new Flink SQL job running in batch mode to handle the ingestion of each file.

Another approach you might be tempted by would be to implement a RichFlatMapFunction that accepts the path as input, reads the file, and emits its records one by one. But this is likely to not work very well unless the files are rather small because Flink really doesn't like to have user functions that run for long periods of time.

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