PrepAway - Latest Free Exam Questions & Answers

What is the behavior of the default partitioner?

What is the behavior of the default partitioner?

PrepAway - Latest Free Exam Questions & Answers

A.
The default partitioner assigns key value pairs to reducers based on an internal random number
generator.

B.
The default partitioner implements a round robin strategy, shuffling the key value pairs to each
reducer in turn. This ensures an even partition of the key space.

C.
The default partitioner computes the hash of the key. Hash values between specific ranges are
associated with different buckets, and each bucket is assigned to a specific reducer.

D.
The default partitioner computes the hash of the key and divides that value modulo the number
of reducers. The result determines the reducer assigned to process the key-value pair.

E.
The default partitioner computes the hash of the value and takes the mod of that value with the
number of reducers. The result determines the reducer assigned to process the key value pair.

Explanation:
The default partitioner computes a hash value for the key and assigns the partition
based on this result.
The default Partitioner implementation is called HashPartitioner. It uses the hashCode() method of
the key objects modulo the number of partitions total to determine which partition to send a given
(key, value) pair to.
In Hadoop, the default partitioner is HashPartitioner, which hashes a record’s key to determine
which partition (and thus which reducer) the record belongs in.The number of partition is then
equal to the number of reduce tasks for the job.
Reference:Getting Started With (Customized) Partitioning

3 Comments on “What is the behavior of the default partitioner?

  1. Ramesh Hiremath says:

    D.
    The default partitioner computes the hash of the key and divides that value modulo the number
    of reducers. The result determines the reducer assigned to process the key-value pair.




    0



    0

Leave a Reply to Vinod Cancel reply

Your email address will not be published. Required fields are marked *