生成HDFS序列文件

时间:2012-10-12 17:21:24

标签: hadoop apache-pig hdfs

我使用org.apache.pig.PigServer类从Java运行pig脚本。 我需要以gz压缩的顺序格式输出我的文件。 这就是我所做的:

effectivePigProperties.put("mapred.output.compress", "true");
effectivePigProperties.put("mapred.output.format.class", "org.apache.hadoop.mapred.SequenceFileOutputFormat");
effectivePigProperties.put("mapred.output.compression.type", "SequenceFile.CompressionType.BLOCK");
effectivePigProperties.put("mapred.output.compression.codec", "org.apache.hadoop.io.compress.GzipCodec");

输出是gz但不是序列文件。 我错过了什么?

1 个答案:

答案 0 :(得分:0)

虽然Apache Pig捆绑包(也不是Piggybank)中没有,但Twitter的Elephant Bird库提供了一个SequenceFileStorage implementation,你可以使用它。

相关问题