gpt4 book ai didi

hadoop - AvroStorage - 输出文件名定义

转载 作者:可可西里 更新时间:2023-11-01 16:48:16 24 4
gpt4 key购买 nike

我使用 AvroStorage 存储 pig 的结果集。有没有一种方法可以将数据存储到一个指定的 avro 文件中……例如 OutputFileGen1? Pig 将数据存储到名为 OutpuFileGen1 的目录中,其结构如下所示:

 ls -al  OutputFileGen1/
total 20
drwxr-xr-x 2 root root 4096 2016-01-18 14:35 .
drwxr-xr-x 6 root root 4096 2016-01-19 10:27 ..
-rw-r--r-- 1 root root 4083 2016-01-18 14:35 part-m-00000.avro
-rw-r--r-- 1 root root 40 2016-01-18 14:35 .part-m-00000.avro.crc
-rw-r--r-- 1 root root 0 2016-01-18 14:35 _SUCCESS
-rw-r--r-- 1 root root 8 2016-01-18 14:35 ._SUCCESS.crc

谢谢

最佳答案

pig 输出目录中的部分数量取决于您的作业执行的并行任务数量。这里只有一个文件:part-m-00000。

http://pig.apache.org/docs/r0.8.1/cookbook.html#Use+the+Parallel+Features

但也许你有意想要一个文件,所以如果你想得到这个文件,我建议使用 hadoop fs -getmerge <src dir> <target dir>命令,获取本地文件系统中的文件,以便使用它包含的数据。

关于hadoop - AvroStorage - 输出文件名定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34880880/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com