To enable compression for a hive task

Source: Internet
Author: User

1. Enable compression for the Map intermediate output.

Generally for intermediate output compression using a low compression ratio, high compression decompression speed compression algorithm, such as Lzo,snappy

Set hive.exec.compress.intermediate=true;

Set mapred.map.output.compression.codec=Com.hadoop.compression.lzo.LzoCodec;

2. Enable compression for final output results

It is important to note that some compression formats do not support sharding, so that subsequent mapre-reduce tasks will not be processed in parallel.

Set hive.exec.compress.output=true;

Set Mapred.output.compression.codec=org.apache.hadoop.io.compress.gzipcodec;

3. Use sequence file format for output

CREATE table tname stored as sequencefile;

turn on compression for sequence file files

Set Mapred.output.compression.type=block;

Common compression formats:

deflate org.apache.hadoop.io.compress.defaultcodec
gzip org.apache.hadoop.io.compress.gzipcodec
bzip org.apache.hadoop.io.compress.bzip2codec
snappy org.apache.hadoop.io.compress.snappycodec



To enable compression for a hive task

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.