nerdexam
Cloudera

CCD-410 · Question #59

You have written a Mapper which invokes the following five calls to the OutputColletor.collect method: output.collect (new Text ("Apple"), new Text ("Red") ) ; output.collect (new Text ("Banana")…

The correct answer is B. 3. reduce() gets called once for each [key, (list of values)] pair. To explain, let's say you called: out.collect(new Text("Car"),new Text("Subaru"); out.collect(new Text("Car"),new Text("Honda"); out.collect(new Text("Car"),new Text("Ford"); out.collect(new Text("Truck"),new…

Hadoop Ecosystem Fundamentals

Question

You have written a Mapper which invokes the following five calls to the OutputColletor.collect method:

output.collect (new Text ("Apple"), new Text ("Red") ) ; output.collect (new Text ("Banana"), new Text ("Yellow") ) ; output.collect (new Text ("Apple"), new Text ("Yellow") ) ; output.collect (new Text ("Cherry"), new Text ("Red") ) ; output.collect (new Text ("Apple"), new Text ("Green") ) ; How many times will the Reducer's reduce method be invoked?

Options

  • A6
  • B3
  • C1
  • D0
  • E5

How the community answered

(29 responses)
  • B
    83% (24)
  • C
    10% (3)
  • D
    3% (1)
  • E
    3% (1)

Explanation

reduce() gets called once for each [key, (list of values)] pair. To explain, let's say you called: out.collect(new Text("Car"),new Text("Subaru"); out.collect(new Text("Car"),new Text("Honda"); out.collect(new Text("Car"),new Text("Ford"); out.collect(new Text("Truck"),new Text("Dodge"); out.collect(new Text("Truck"),new Text("Chevy"); Then reduce() would be called twice with the pairs reduce(Car, <Subaru, Honda, Ford>) reduce(Truck, <Dodge, Chevy>)

Topics

#MapReduce#Reducer#distinct keys#key grouping

Community Discussion

No community discussion yet for this question.

Full CCD-410 Practice