title: How to sort data in map reduce hadoop?
body: <p>I am working with a programme that has 4 MapReduce steps.the output of my first step is:</p>
  
  <pre><code>id      value
   1        20
   2         3
   3         9
   4        36
  </code></pre>
  
  <p>I have about 1,000,000 IDs and in the second step i must sort the values.the output of this step:</p>
  
  <pre><code> id      value
   4        36
   1        20
   3         9
   2         3
  </code></pre>
  
  <p>How can I sort my data in map reduce? Do I need to use terasort? If yes, how do I use terasort in second step of my programme? 
  Thanks.</p>