英文:
How to create tar.gz file using apache beam
问题
我使用以下内容创建了一个 tar.gz
文件,生成了一个 .gz
文件,但 tar 文件不可用。如何实现想要的结果?
PCollection<String> lines = pipeline.apply("读取文件",
TextIO.read().from(<文件路径>));
lines.apply(TextIO.write()
.to("C:\\Ddrive\\saveAllRequest1.txt")
.withCompression(Compression.GZIP);
还有,如何对多个文件进行打包(tar)操作。
提前致谢。
英文:
I used the below to create a tar.gz
file, and .gz
file was created but tar file was not available. How to achieve the result?
PCollection<String> lines = pipeline.apply("To read from file",
TextIO.read().from(<file path>));
lines.apply(TextIO.write()
.to("C:\\Ddrive\\saveAllRequest1.txt")
.withCompression(Compression.GZIP);
and how to tar multiple files.
Thanks in advance
答案1
得分: 1
创建 tar
文件是一种固有的非并行操作。这里的一个选项是,在使用手动创建tarball的DoFn进行写入后,使用Wait 转换。
英文:
Creating a tar
file is an inherently non-parallel operation. One option here is to use the Wait transform after your write with a DoFn that manually creates the tarball.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论