Access Keys:
Skip to content (Access Key - 0)

How to use compression with Pentaho MapReduce. This guide uses the Snappy compression codec in its examples, but you may use any compression codec you choose that is supported in Hadoop. The following scenarios are covered:

  • Reading Compressed Files
  • Writing Compressed Files
  • Compressing Intermediate Data

Prerequisites

In order to follow along with this how-to guide you will need the following:

  • Hadoop
  • Pentaho Data Integration
  • Pentaho Hadoop Distribution
  • Compression Codec Installed on Hadoop

Step-By-Step Instructions

Reading Compressed Files

Normally there is nothing you need to do to have Pentaho MapReduce use a compressed file as the the input. Pentaho MapReduce will automatically decompress any compression codec installed on the Hadoop cluster.

Writing Compressed Files

  1. Start PDI on your desktop. Once it is running choose 'File' -> 'Open', browse to and select your job running Pentaho MapReduce, then click 'OK'.
  2. Configure the Compression Codec: Double click on the 'Pentaho MapReduce' step, switch to the 'User Defined' tab and enter the following information:
    Name Value
    mapred.output.compression.codec The compression codec to use. For example org.apache.hadoop.io.compress.SnappyCodec
    mapred.output.compress true
    mapred.output.compression.type BLOCK

  3. Run your job

The output from the job should be compressed using the codec you specified.

Compressing Intermediate Data

You may want to compress the intermediate data that is passed between the Pentaho Mappers and Reducers to reduce network i/o and in some cases improve performance.

  1. Start PDI on your desktop. Once it is running choose 'File' -> 'Open', browse to and select your job running Pentaho MapReduce, then click 'OK'.
  2. Configure the Compression Codec: Double click on the 'Pentaho MapReduce' step, switch to the 'User Defined' tab and enter the following information:
    Name Value
    mapred.map.output.compression.codec The compression codec to use. For example org.apache.hadoop.io.compress.SnappyCodec
    mapred.compress.map.output true

  3. Run your job

This documentation is maintained by the Pentaho community, and members are encouraged to create new pages in the appropriate spaces, or edit existing pages that need to be corrected or updated.

Please do not leave comments on Wiki pages asking for help. They will be deleted. Use the forums instead.

Adaptavist Theme Builder (4.2.0) Powered by Atlassian Confluence 3.3.3, the Enterprise Wiki