Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the Snappy compression codec in Hadoop configuration.
Hadoop
conf.set("mapreduce.output.fileoutputformat.compress.codec", [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Gzip codec class instead of Snappy.
Using Lz4 codec which is different from LZO.
Forgetting to put quotes around the class name.
✗ Incorrect
Snappy codec class is org.apache.hadoop.io.compress.SnappyCodec.
2fill in blank
mediumComplete the code to enable compression for MapReduce output.
Hadoop
conf.setBoolean("mapreduce.output.fileoutputformat.compress", [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing string 'true' instead of boolean true.
Passing false which disables compression.
✗ Incorrect
Use boolean true (not string) to enable compression.
3fill in blank
hardFix the error in setting the LZO codec class name for compression.
Hadoop
conf.set("mapreduce.output.fileoutputformat.compress.codec", [1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'LzopCodec' instead of 'LzoCodec'.
Using 'org.apache.hadoop.io.compress' package for LZO.
✗ Incorrect
The correct LZO codec class is com.hadoop.compression.lzo.LzoCodec.
4fill in blank
hardFill both blanks to create a configuration snippet that enables Gzip compression and sets the codec.
Hadoop
conf.setBoolean("mapreduce.output.fileoutputformat.compress", [1]) conf.set("mapreduce.output.fileoutputformat.compress.codec", [2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Disabling compression but setting codec.
Setting Snappy codec instead of Gzip.
✗ Incorrect
Enable compression with true and set codec to Gzip class.
5fill in blank
hardFill all three blanks to create a dictionary that maps codec names to their class names for Snappy, LZO, and Gzip.
Hadoop
codecs = {"Snappy": [1], "LZO": [2], "Gzip": [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up codec class names.
Using DefaultCodec instead of specific codecs.
✗ Incorrect
Each codec name maps to its correct class name string.