Property 'mapreduce.output.fileoutputformat.compress' is set to 'true', so compression is enabled.
Step 2: Identify the codec class used
Codec class is 'org.apache.hadoop.io.compress.GzipCodec', which means Gzip compression is used.
Final Answer:
Gzip -> Option D
Quick Check:
Compression enabled with Gzip codec [OK]
Hint: Check compress property true + codec class name [OK]
Common Mistakes:
Ignoring the compress flag and assuming no compression
Confusing codec class with Snappy or LZO
Assuming default codec if not checked
4. You configured LZO compression in your Hadoop job, but the job fails with a codec not found error. What is the most likely cause?
medium
A. LZO native libraries are not installed or not in the library path
B. The job configuration property name is misspelled
C. Snappy codec is enabled instead of LZO
D. Gzip compression is incompatible with Hadoop
Solution
Step 1: Understand LZO codec requirements
LZO requires native libraries installed on all cluster nodes to work properly.
Step 2: Analyze error cause
Codec not found error usually means native LZO libraries are missing or not accessible in the library path.
Final Answer:
LZO native libraries missing or not in path -> Option A
Quick Check:
LZO needs native libs installed [OK]
Hint: LZO needs native libs installed on cluster nodes [OK]
Common Mistakes:
Assuming misspelled property causes codec not found
Confusing Snappy and LZO codec errors
Thinking Gzip is incompatible with Hadoop
5. You want to compress large Hadoop output files with the best compression ratio but can tolerate slower speed. Which codec should you choose and why?
hard
A. Gzip, because it offers the best compression ratio despite slower speed
B. LZO, because it balances speed and compression
C. Snappy, because it is fastest and good compression
D. No compression, to avoid overhead
Solution
Step 1: Identify compression needs
Best compression ratio means smallest file size, speed is less important.
Step 2: Compare codecs by compression ratio and speed
Gzip compresses better but slower; Snappy is fastest but less compression; LZO is in between.
Step 3: Choose codec matching needs
Gzip fits best for high compression ratio with slower speed tolerance.
Final Answer:
Gzip, best compression ratio with slower speed -> Option A
Quick Check:
Best compression ratio = Gzip [OK]
Hint: Best compression ratio usually means Gzip codec [OK]
Common Mistakes:
Choosing Snappy for best compression ratio
Thinking LZO compresses better than Gzip
Avoiding compression despite need to save space
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.