Complete the code to set the number of reducers in a Hadoop job.
job.setNumReduceTasks([1])Setting the number of reducers to 5 helps balance load and speed up the job.
Complete the code to set the memory allocation for map tasks.
conf.set("mapreduce.map.memory.mb", "[1]")
Allocating 2048 MB memory to map tasks helps prevent out-of-memory errors and slow processing.
Fix the error in setting the input split size to optimize job performance.
conf.setLong("mapreduce.input.fileinputformat.split.maxsize", [1])
The value must be a long integer without quotes or suffixes to set max split size correctly.
Fill both blanks to configure speculative execution to prevent slow tasks.
conf.setBoolean("mapreduce.map.speculative", [1]) conf.setBoolean("mapreduce.reduce.speculative", [2])
Enabling speculative execution for both map and reduce tasks helps avoid slow tasks delaying the job.
Fill both blanks to create a dictionary comprehension that filters and maps data sizes.
sizes = {file:file_size[file]**2 for file in files if file_size[file] [1] 1000 and file_size[file] [2] 100000}The dictionary comprehension uses ':' to map file to size squared, and filters sizes between 1000 and 100000.