I just cannot get a clear picture of so called 'splittable' codec due to lack of compression knowledge. For instanse, gzip vs. bzip2, I do see that when running a MapReduce against a ~400M gzip file, it only spins up one mapper, while for bzip2, it spins up 4 mappers.
What is the fundamental problem that makes gzip not splittable? I've heard that gzip is not splittable because it stores its 'metadata' in the file header while bzip2 stores 'metadata' for each block.
If this is the only problem prevents gzip from being splittable, why not simply let all gzip decompressor threads first go to the file header to fetch the 'metadata', then each thread takes care of part of the compressed file?
Another question, for bzip2, it breaks the file into multiple blocks. Is it possible that one record (one line if we take text file as example) been splitted into 2 parts and placed in 2 different blocks? Does bzip2 care about the record completeness when creating block?
Many thanks!