Oh Yes, you are right, i replied to this mail, saying yes. However, that yes was for the keys which are sorted. sorry for the confusion.
H. Kumar Phone(Mobile): +82-10-2892-9663 Phone(Office): +82-31- skype: harshit900 Blog: http://harshitkumar.wordpress.com Website: http:/kumarharmuscat.tripod.com 2009/11/17 Owen O'Malley <owen.omal...@gmail.com> > On Mon, Nov 16, 2009 at 11:43 AM, Something Something < > mailinglist...@gmail.com> wrote: > > > Does Hadoop Mapreduce guarantee that the *values* returned by Mapper to > the > > Reducer are sorted? Can I safely assume that? Would it always be true - > > at > > least for 'Text' type? > > > > public void reduce(Text key, *Iterable<Text> values*, Context context > > > > No, the values will *not* be sorted. In fact, it will be non-deterministic > between multiple runs of the job with the same input. The keys will always > be sorted. If you want the values to be sorted, you need to take additional > steps. Please look at the SecondarySort example. It shows exactly how to > get > the values sorted in the order you desire. > > -- Owen >