title: Comparing data from same file in reducer function of a map reduce program
body: <p>In my map reduce program, the mapper function will give two key value pair:</p>
  
  <p>1) (person1, age)</p>
  
  <p>2) (person2, age)</p>
  
  <p>(I have kept 2 pairs only for simplicity it would be nice if u can explain for n nos of line)</p>
  
  <p>Now I want to write a reducer which will compare age of both and give the answer who is older.</p>
  
  <p>The thing I cannot understand is the output of mapper will be in different line in the file. And as reducer works on line by line bases over a file how will it compare them.
  Thanks in advance.</p>