读书人

在Pig中应用Lzo

发布时间: 2013-03-29 14:24:52 作者: rapoo

在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

?

?

读书人网 >软件架构设计

热点推荐