In the MR job
FileOutputFormat.setCompressOutput(job, true);
FileOutputFormat.setOutputCompressorClass(job, GzipCodec.class);
MultipleOutputs.addNamedOutput(job, OUTPUT, TextOutputFormat.class, NullWritable.class, Text.class);
In my Reducer
String myKey = "key"+i;
mos.write(OUTPUT, NullWritable.get(), new Text(lin), myKey);
The actual output files:
key10-r-00001.gz
key10-r-00002.gz
key11-r-00000.gz
key11-r-00006.gz
key19-r-00000.gz
But what I'm expecting is as follows:
key10.gz
key11.gz
key19.gz
Do I need to use shell script to rename and merge the actual output files? Or are there any other solutions I can try in MR Job without any extra steps? Thank you!