2012-10-12 54 views
1

我使用org.apache.pig.PigServer类从Java运行猪脚本。 我需要以gz压缩的顺序格式输出我的文件。 这是我做了什么:生成HDFS序列文件

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"); 

输出为广州,但没有排序文件。 我在想什么?

+0

重复问题:http://stackoverflow.com/questions/2423949/storing-data-to-sequencefile-from-apache-pig – octo

回答

0

虽然没有出现在Apache Pig软件包(也不是它的Piggybank)中,但是Twitter的Elephant Bird库提供了一个可以使用的SequenceFileStorage implementation