At the start of your reduce
Where fs is a FileSystem object available via the getFileSystem(conf) method of Path.
   FSDataOutputStream out = fs.create( destinationFile );
then write to your out as normal
then close it at the end of your reduce body.
You will need to save the JobConf (conf) in the configure method of your reducer, which you will have to override.


Lincoln Ritter wrote:
Greetings,

I have what I think is a pretty straight-forward, noobie question.  I
would like to write one file per key in the reduce (or map) phase of a
mapreduce job.  I have looked at the documentation for
FileOutputFormat and MultipleTextOutputFormat but am a bit unclear on
how to use it/them.  Can anybody give me a quick pointer?

Thanks very much!

-lincoln

--
lincolnritter.com

Reply via email to