Question Locked

Which sorting algorithm is used in Map-Reduce Hadoop( bigdata-hadoop)

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Which sorting algorithm is used in MapReduce Hadoop?

3 replies

by ganeshsh

Sorting is done at reducer node based on keys.
Mapper class takes help of WritableComparator class to sort the key-value pair generated from Reducer. WritableComparator class implenets Java’s RawComparator interface. WritableCompratpr class’s compare method is responsible for sorting of key-value pair performed by byte by byte comparison of key.
Merge sort algorithm is used by default in MapReduce. We can’t change sorting algorithm as the data comes from different nodes in a single point and the best suited sorting algorithm is defined as Merge Sort.

by vishalgoud

Sorting is done at reducer node based on keys.
Mapper class takes help of WritableComparator class to sort the key-value pair generated from Reducer. WritableComparator class implenets Java’s RawComparator interface. WritableCompratpr class’s compare method is responsible for sorting of key-value pair performed by byte by byte comparison of key.
Merge sort algorithm is used by default in MapReduce. We can’t change sorting algorithm as the data comes from different nodes in a single point and the best suited sorting algorithm is defined as Merge Sort.

This discussion is closed to new replies.