2015-12-11 52 views

回答

0

你必須使用SequenceFileOutputFormat:在二進制(RAW)格式寫入鍵,值SequenceFiles的OUTPUTFORMAT

你可以在SequenceFile.CompressionType三個變化

BLOCK:以塊的形式將記錄序列壓縮在一起。

NONE:不壓縮記錄。

RECORD:僅壓縮值,每個值分開。

代碼中的關鍵更改。

Path outDir = new Path(WORK_DIR_PREFIX + "/out/" + jobName); 

job.setOutputFormatClass(SequenceFileOutputFormat.class); 

SequenceFileOutputFormat.setOutputPath(job, outDir); 

SequenceFileOutputFormat.setOutputCompressionType(job, CompressionType.BLOCK); 

查看使用SequenceFileOutputFormat的工作example

相關問題