Reputation: 147
I am confused since I have found two answers for it.
1) As per Hadoop Definitive Guide - 3rd edition, Chapter 6 - The Map Side says: "Before it writes to disk, the thread first divides the data into partitions corresponding to the reducers that they will ultimately be sent to. Within each partition, the back-ground thread performs an in-memory sort by key, and if there is a combiner function, it is run on the output of the sort.
2)Yahoo developers tutorial (Yahoo tutorial) says Combiner runs prior to partitioner.
Can anyone please clarify which runs first.
Upvotes: 1
Views: 5413
Reputation: 38910
A Map Reduce Job may contain one or all of these phases
Map
Combine
Shuffle and Sort
Reduce
Partitioner
fits between second and third phase
You can visit this link for more details.
After going through related SE questions & articles,
What runs first: the partitioner or the combiner?
Who will get a chance to execute first , Combiner or Partitioner?
we can see that opinion is divided.
But logically I feel that
It implies that Partitioner should run first and combiner has to run on output data with-in each partition.
Upvotes: 7