在Pig中使用Lzo

一、寻找依赖包

要在pig下使用lzo,我们需要第三方lib,目前我在使用的是twitter的elephant-bird,项目地址:

 

https://github.com/kevinweil/elephant-bird

 你可以自己编译出jar文件,我比较懒直接使用maven库(search.maven.org)中的lib,地址如下:

 

# elephant-bird-pig-3.0.8.jar
http://search.maven.org/remotecontent?filepath=com/twitter/elephantbird/elephant-bird-pig/3.0.8/elephant-bird-pig-3.0.8.jar
# elephant-bird-core-3.0.8.jar
http://search.maven.org/remotecontent?filepath=com/twitter/elephantbird/elephant-bird-core/3.0.8/elephant-bird-core-3.0.8.jar

 

二、使用Pig Lzo (elephant-bird)

写道
> pig
REGISTER 'elephant-bird-core-3.0.8.jar';
REGISTER 'elephant-bird-pig-3.0.8.jar';
rows = LOAD '/user/hdfs/test.lzo' USING com.twitter.elephantbird.pig.load.LzoTextLoader;
....

 

--end

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值