title: Sorting large data using MapReduce/Hadoop
body: <p>I am reading about MapReduce and the following thing is confusing me.</p>
  
  <p>Suppose we have a file with 1 million entries(integers) and we want to sort them using MapReduce. The way i understood to go about it is as follows:</p>
  
  <p>Write a mapper function that sorts integers. So the framework will divide the input file into multiple chunks and would give them to different mappers. Each mapper will sort their chunk of data independent of each other. Once all the mappers are done, we will pass each of their results to Reducer and it will combine the result and give me the final output.</p>
  
  <p>My doubt is, if we have one reducer, then how does it leverage the distributed framework, if, eventually, we have to combine the result at one place?. The problem drills down to merging 1 million entries at one place. Is that so or am i missing something?</p>
  
  <p>Thanks,
  Chander</p>