Cloudera Certified Developer for Apache Hadoop (CCDH) — Question 1
You have the following key-value pairs as output from your Map task:
(the, 1)
(fox, 1)
(faster, 1)
(than, 1)
(the, 1)
(dog, 1)
How many keys will be passed to the Reducer's reduce method?
Answer options
- A. Six
- B. Five
- C. Four
- D. Two
- E. One
- F. Three
Correct answer: A
Explanation
The correct answer is A, as the distinct keys are 'the', 'fox', 'faster', 'than', and 'dog', resulting in five unique keys. However, the key 'the' appears twice. In total, since the reduce method receives unique keys, it will handle six pairs, but only five unique keys are processed. Thus, the answer is based on the number of key-value pairs output, which equals six.