【问题标题】:Is there a way to split/autoscale gzip source files in Dataflow?有没有办法在 Dataflow 中拆分/自动缩放 gzip 源文件?
【发布时间】:2020-02-21 12:53:46
【问题描述】:

我现在正在努力使用管道模板。 输入文件是否被 gzip 压缩时,我没有相同的行为。

以下是 csv 文件的工作日志:

Splitting filepattern gs://bucket/file.csv into bundles of size 22369621 took 125 ms and produced 1 files and 128 bundles
Splitting source gs://bucket/file.csv into bundles of estimated size 22369621 bytes produced 128 bundles. Rebundling into 100 bundles.
Splitting source gs://bucket/file.csv produced 100 bundles with total serialized response size 187328

然后源被正确拆分,作业自动缩放到任务的适当工人数量。

现在这是完全相同文件的日志,现在已压缩:

Splitting filepattern gs://bucket/file.csv.gz into bundles of size 22369621 took 137 ms and produced 1 files and 1 bundles
Splitting source gs://bucket/file.csv.gz produced 1 bundles with total serialized response size 1925

然后,一旦数据开始通过,几秒钟/几分钟后,这些就会弹出:

Proposing dynamic split of work unit dev01-processing;2020-02-21_03_30_25-2364220079620552332;7684124696241385390 at {"fractionConsumed":0.5126594305038452}
Rejecting split request because custom reader returned null residual source.

它似乎无法缩放,可能是因为文件的大小不是预期的。

代码如下:

ValueProvider<String> input = options.getInput();
Pipeline p = Pipeline.create(options);
PCollection<String> csvLines = p.apply(TextIO.read().from(input)/*.withCompression(Compression.GZIP)*/);
...

我只需要删除 cmets 即可使用“gzip 输入”版本构建模板。

是否有什么我做错了阻止工作使用 gzip 输入自动缩放?

【问题讨论】:

  • 做一些研究,似乎 GZIP 是不可拆分的,所以我可能不得不使用 BZ2 来代替? comphadoop.weebly.com
  • 好吧......回答我自己:与 BZ2 文件的行为相同

标签: google-cloud-platform google-cloud-dataflow apache-beam


【解决方案1】:

here 提到压缩源不可拆分。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-04-28
    • 2016-03-30
    • 2022-07-21
    • 1970-01-01
    • 2010-12-05
    相关资源
    最近更新 更多