I am new to hadoop here. It is not clear why we need to be able to sort by keys while using hadoop mapreduce ? After map phase, we need to distribute the data corresponding to each unique key to some number of reducers. This can be done without having the need to sort it right ?
Share
It is there, because sorting is a neat trick to group your keys. Of course, if your job or algorithm does not need any order of your keys, then you will be faster to group by some hashing trick.
In Hadoop itself, there is already a JIRA filed for that since years (source).
Several other distributions that layer on top of Hadoop have these features already, Hanborq for example (they call it sort avoidance). (source)
To your actual question (Why), MapReduce was inherently a paper from Google (source) which states the following:
So it was more a convenience decision to support sort, but not to inherently only allow sort to group keys.