title: Converting MapWritable to a string in Hadoop
body: <p>When I run my output with the toString() method I am getting:</p>
  
  <pre><code>#zombie org.apache.hadoop.io.MapWritable@b779f586
  #zombies        org.apache.hadoop.io.MapWritable@c8008ef9
  #zona   org.apache.hadoop.io.MapWritable@99e061a1
  #zoology        org.apache.hadoop.io.MapWritable@9d0060be
  #zzp    org.apache.hadoop.io.MapWritable@3e52c108
  </code></pre>
  
  <p>Here is my reducer code, how can I get the map values to print out instead?</p>
  
  <pre><code>package sample;
  
  import java.io.IOException;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.MapWritable;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.io.Writable;
  import org.apache.hadoop.mapreduce.Reducer;
  
  public class IntSumReducer 
  extends Reducer&lt;Text,MapWritable,Text,MapWritable&gt; {
  private MapWritable result = new MapWritable();
  String temp = "";
  public void reduce(Text key, Iterable&lt;MapWritable&gt; values, Context context)throws IOException, InterruptedException {
      result.clear();
      for (MapWritable val : values) {
          Iterable&lt;Writable&gt; keys = val.keySet();
          for (Writable k : keys) {
              IntWritable tally = (IntWritable) val.get(k);
              if (result.containsKey(k)) {
                  IntWritable tallies = (IntWritable) result.get(k);
                  tallies.set(tallies.get() + tally.get());
                  temp = toString() + " : " + tallies.get();
                  result.put(new Text(temp), tallies);
              } else {
                  temp = k.toString() + " : " + tally.get();
                  result.put(new Text(temp), tally);
              }
           }
      }
      context.write(key, result);
  }
  }
  </code></pre>
  
  <p>Thanks for the help</p>