PrepAway - Latest Free Exam Questions & Answers

What happens in a MapReduce job when you set the number of reducers to zero?

What happens in a MapReduce job when you set the number of reducers to zero?

PrepAway - Latest Free Exam Questions & Answers

A.
No reducer executes, but the mappers generate no output.

B.
No reducer executes, and the output of each mapper is written to a separate file in HDFS.

C.
No reducer executes, but the outputs of all the mappers are gathered together and written to a
single file in HDFS.

D.
Setting the number of reducers to zero is invalid, and an exception is thrown.

Explanation:
*It is legal to set the number of reduce-tasks to zero if no reduction is desired.
In this case the outputs of the map-tasks go directly to the FileSystem, into the output path set by
setOutputPath(Path). The framework does not sort the map-outputs before writing them out to the
FileSystem.
*Often, you may want to process input data using a map function only. To do this, simply set
mapreduce.job.reduces to zero. The MapReduce framework will not create any reducer tasks.

Rather, the outputs of the mapper tasks will be the final output of the job.

4 Comments on “What happens in a MapReduce job when you set the number of reducers to zero?


Leave a Reply

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