nerdexam
Cloudera

CCD-410 · Question #36

How are keys and values presented and passed to the reducers during a standard sort and shuffle phase of MapReduce?

The correct answer is A. Keys are presented to reducer in sorted order; values for a given key are not sorted. Reducer has 3 primary phases: The Reducer copies the sorted output from each Mapper using HTTP across the network. The framework merge sorts Reducer inputs by keys (since different Mappers may have output The shuffle and sort phases occur simultaneously i.e. while outputs are…

Developing with Apache Spark Core

Question

How are keys and values presented and passed to the reducers during a standard sort and shuffle phase of MapReduce?

Options

  • AKeys are presented to reducer in sorted order; values for a given key are not sorted.
  • BKeys are presented to reducer in sorted order; values for a given key are sorted in ascending order.
  • CKeys are presented to a reducer in random order; values for a given key are not sorted.
  • DKeys are presented to a reducer in random order; values for a given key are sorted in ascending order.

How the community answered

(19 responses)
  • A
    74% (14)
  • B
    5% (1)
  • C
    5% (1)
  • D
    16% (3)

Explanation

Reducer has 3 primary phases: The Reducer copies the sorted output from each Mapper using HTTP across the network. The framework merge sorts Reducer inputs by keys (since different Mappers may have output The shuffle and sort phases occur simultaneously i.e. while outputs are being fetched they are To achieve a secondary sort on the values returned by the value iterator, the application should extend the key with the secondary key and define a grouping comparator. The keys will be sorted using the entire key, but will be grouped using the grouping comparator to decide which keys and values are sent in the same call to reduce. In this phase the reduce(Object, Iterable, Context) method is called for each <key, (collection of values)> in the sorted inputs. The output of the reduce task is typically written to a RecordWriter via TaskInputOutputContext.write(Object, Object). The output of the Reducer is not re-sorted.

Topics

#shuffle and sort#key sorting#reducer input order#MapReduce

Community Discussion

No community discussion yet for this question.

Full CCD-410 Practice