I have a reducer that outputs pairs of the form . The
MapWritable is a map from Text to Long. The key and output values of my
reducer are declared like so:
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(MapWritable.class);
The last few lines of my reducer look like this:
MapWritable works if you use a binary format like
SequenceFileOutputFormat. If you need a plain text output, you can use a
library like Jackson to generate a string representation -- or look for
a custom OutputFormat that already does that for you.
I have a reducer that outputs pairs of the for