在Hadoop / PIG中压缩/解压gzip数据是否透明?

编程入门 行业动态 更新时间:2024-10-22 19:36:35
本文介绍了在Hadoop / PIG中压缩/解压gzip数据是否透明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在某处读到Hadoop内置了对压缩和解压缩的支持,但我想这是关于mapper输出(通过设置一些属性)?

我想知道是否有任何特定的PIG加载/存储功能可用于读取压缩数据或以压缩格式输出数据?

解决方案

PigStorage通过检查文件名来处理压缩输入:

  • *。bz2 / * .bz - org.apache.pig.bzip2r.Bzip2TextInputFormat
  • else使用 org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigTextInputFormat - 这扩展了 oahmapreduce.TextinputFormat 它可以处理.gz和zippy文件,如果你已经安装了编解码器

    输出通过一些属性处理:

  • / p>
    • outputpression.enabled - true / false $ b $ ( org.apache.hadoop.iopress.GzipCodec / code> for gzip)

    如果您对此感兴趣,可以通过PigStorage.java进行挖掘对你的兴趣

    I read somewhere that Hadoop has a built-in support for compression and decompression but I guess it is about mapper output (by setting some properties)?

    I wonder if there is any particular PIG load/store functions I can use for reading compressed data or outputting data as compressed?

    解决方案

    The PigStorage handles compressed input by examining the file names:

    • *.bz2 / *.bz - org.apache.pig.bzip2r.Bzip2TextInputFormat
    • Everything else uses org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigTextInputFormat -- This extends o.a.h.mapreduce.TextinputFormat which can handle .gz and zippy files if you have the codecs installed

    Output is handled via some properties:

    • outputpression.enabled - true / false
    • outputpression.codec - the class name of the codec to use (org.apache.hadoop.iopress.GzipCodec for gzip)

    If you're feeling up to it, digging through the PigStorage.java may be of interest to you

更多推荐

在Hadoop / PIG中压缩/解压gzip数据是否透明?

本文发布于:2023-10-16 05:39:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496657.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:透明   数据   Hadoop   PIG   gzip

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!