如何使用Google Cloud Dataflow将压缩文件写入Google Cloud Storage?
问题描述:
我正尝试在Google Dataflow程序中将Gzip文件写入Google Cloud Storage存储桶。常见问题解答说如何使用Google Cloud Dataflow将压缩文件写入Google Cloud Storage?
Does the TextIO source and sink support compressed files, such as GZip?
Yes. Cloud Dataflow can read files compressed with gzip and bzip2.
这是否意味着他们不支持写入GZip文件?
答
在新梁库,你现在可以做到这一点更容易:
PDone d = c2.apply(TextIO.write()
.to("gs://path")
.withWritableByteChannelFactory(FileBasedSink.CompressionType.GZIP));
谢谢。您可能想要解决[这里](https://cloud.google.com/dataflow/model/reading-and-writing-data#TextIO),因为文档提到您可以使用withCompressionType写入gzip文件 – user2254391
我们将修复文档,谢谢! – jkff
相关文档现在显示在以下位置:https://cloud.google.com/dataflow/model/text-io – Steven