Apache Beam Fileio写下压缩文件

发布于 2025-02-13 21:54:47 字数 431 浏览 0 评论 0原文

我想知道是否可以使用Apache Beam Python SDK的Fileio模块编写压缩文件。目前,我使用模块将文件写入GCP存储桶:

_ = (logs | 'Window' >> beam.WindowInto(window.FixedWindows(60*60))
    | 'Convert to JSON' >>  beam.ParDo(ConvertToJson())
    | 'Write logs to GCS file' >> fileio.WriteToFiles(path = gsc_output_path, shards=1, max_writers_per_bundle=0))

压缩将有助于最大程度地降低存储成本。

根据

我对此是对的,还是有人知道该怎么做?

谢谢你!

I would like to know if it's possible to write compressed files using the fileio module from Apache Beam, Python SDK. At the moment I am using the module to write files to a GCP bucket:

_ = (logs | 'Window' >> beam.WindowInto(window.FixedWindows(60*60))
    | 'Convert to JSON' >>  beam.ParDo(ConvertToJson())
    | 'Write logs to GCS file' >> fileio.WriteToFiles(path = gsc_output_path, shards=1, max_writers_per_bundle=0))

Compression would help in minimizing storage costs.

According to this doc and comment inside class _MoveTempFilesIntoFinalDestinationFn, developers still need to implement handling of compression.

Am I right about this or does someone know how to do it?

Thank you!

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

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

发布评论

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

评论(1

谁人与我共长歌 2025-02-20 21:54:50

开发人员仍然需要实施压缩处理。

这是正确的。

虽然有开放的FRS:

目前,您可以编写DOFN:读取最终文件 - >压缩 - >写下压缩的最终文件并删除原始最终文件。

developers still need to implement handling of compression.

This is correct.

Though there are open FRs:

At the moment, you can write a DoFn: read the final files -> compress -> write the compressed final files and delete original final files.

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