title: hadoop MapReduce sort by value only
body: <p>Is there a way to sort the MapReduce output by value only, and without changing the output sequence of key and value?</p>
  
  <p>the original output is like (sorted by key):</p>
  
  <pre><code>A 1
  
  B 2
  
  C 1
  
  D 3
  </code></pre>
  
  <p>and I need the output like this (sorted by value):</p>
  
  <pre><code>D 3
  
  B 2
  
  A 1
  
  C 1
  </code></pre>
  
  <p>I tried to make it by adding  another sorting job using <code>Inversemapper</code> to swap the key and value so that the output is sorted by value, it worked, however the output is like:</p>
  
  <pre><code>3 D
  
  2 B
  
  1 A
  
  1 C
  </code></pre>
  
  <p>Is there anyway to reverse the output format of key and value?</p>
  
  <p>or is there any other way to sort by value only?</p>
  
  <p>Thanks</p>