PrepAway - Latest Free Exam Questions & Answers

Which statement is most accurate about the ordering of these values?

In a MapReduce job, the reducer receives all values associated with the same key. Which
statement is most accurate about the ordering of these values?

PrepAway - Latest Free Exam Questions & Answers

A.
The values are in sorted order.

B.
The values are arbitrarily ordered, and the ordering may vary from run to run of the same
MapReduce job.

C.
The values are arbitrarily ordered, but multiple runs of the same MapReduce job will always
have the same ordering.

D.
Since the values come from mapper outputs, the reducers will receive contiguous sections of
sorted values.

Explanation:
Note:
*The Mapper outputs are sorted and then partitioned per Reducer.
*The intermediate, sorted outputs are always stored in a simple (key-len, key, value-len, value)
format.
*Input to the Reducer is the sorted output of the mappers. In this phase the framework fetches the
relevant partition of the output of all the mappers, via HTTP.
*A MapReduce job usually splits the input data-set into independent chunks which are processed
by the map tasks in a completely parallel manner. The framework sorts the outputs of the maps,
which are then input to the reduce tasks.
*The MapReduce framework operates exclusively on <key, value> pairs, that is, the framework
views the input to the job as a set of <key, value> pairs and produces a set of <key, value> pairs
as the output of the job, conceivably of different types.
The key and value classes have to be serializable by the framework and hence need to implement
the Writable interface. Additionally, the key classes have to implement the WritableComparable
interface to facilitate sorting by the framework.
Reference:MapReduce Tutorial

6 Comments on “Which statement is most accurate about the ordering of these values?

  1. Avinash says:

    Answer : B.
    Key are sorted, but values are not. Reducer receives values are in arbitrarily ordered, and the ordering may vary from run to run




    0



    0
  2. Ramesh Hiremath says:

    B.
    The values are arbitrarily ordered, and the ordering may vary from run to run of the same
    MapReduce job.




    0



    0

Leave a Reply to Ramesh Hiremath Cancel reply

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