San*_*eep 1 google-cloud-storage google-bigquery google-cloud-dataflow apache-beam
我们如何通过Google数据流作业在GCS中创建压缩文件?
我无法指定压缩类型.如果该功能尚未出现,是否有更简洁的方法从Google BigQuery的查询输出到压缩文件?
您将需要使用TextIO写入文件(有关所有内置I/O转换的概述,请查看此处).
您可以在此处的代码中查看示例:
PCollection<String> lines = ...;
lines.apply(TextIO.write().to("/path/to/file.txt")
.withSuffix(".txt")
.withWritableByteChannelFactory(FileBasedSink.CompressionType.GZIP));
Run Code Online (Sandbox Code Playgroud)
编辑:您还可以直接从GUI将表格从BigQuery导出到gzip压缩文件:
| 归档时间: |
|
| 查看次数: |
318 次 |
| 最近记录: |