在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

猜你喜欢

转载自heipark.iteye.com/blog/1836495
LZO
pig
今日推荐