猪的MultiStorage [英] MultiStorage in pig

查看:123
本文介绍了猪的MultiStorage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在grunt shell中运行了下面的猪脚本

 注册D:\Pig\contrib\piggybank \java\piggybank.jar;使用PigStorage(',')作为(uuid:chararray,timestamp:chararray,名称:chararray,EmailID:chararray,公司名称:chararray,位置:chararray)时,使用

a = load'/ part'

存储到'/ output / multistorage'使用MultiStorage('/ output / multistorage','2','none',',');

运行时会抛出错误,如下所示

  2015-11-03 05:47:36,328 [main] ERROR org.apache.pig.tools.grunt.Grunt  - 错误10 
70:无法解析MultiStorage使用导入:[,java.lang。,org.apache.pig。
builtin。,org.apache.pig.impl.builtin。]

任何一个帮助我吗?

解决方案

您没有将您的函数作为日志声明导入。如果该jar实际上可以被你访问,你可以尝试下面的代码(有一行缺失):

 注册D: \Pig\contrib\piggybank\java\piggybank.jar; 
DEFINE MULTISTORAGE org.apache.pig.piggybank.storage.MultiStorage();
a = LOAD'/ part'USING PigStorage(',')AS(uuid:chararray,timestamp:chararray,Name:chararray,EmailID:chararray,CompanyName:chararray,Location:chararray);
STORE到'/ output / multistorage'中使用MULTISTORAGE('/ output / multistorage','2','none',',');

然后按Name分区。

I have run the below pig script in the grunt shell

Register D:\Pig\contrib\piggybank\java\piggybank.jar;

a = load '/part' using PigStorage(',') as (uuid:chararray,timestamp:chararray,Name:chararray,EmailID:chararray,CompanyName:chararray,Location:chararray);

store a  into '/output/multistorage' USING MultiStorage('/output/multistorage','2', 'none', ',');

while running this it throws error as shown below

2015-11-03 05:47:36,328 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 10
70: Could not resolve MultiStorage using imports: [, java.lang., org.apache.pig.
builtin., org.apache.pig.impl.builtin.]

Can any one help me in this?

解决方案

You did not import your function as the log claims. If the jar is actually accessible for you, you can try the following code (There was one missing line):

REGISTER D:\Pig\contrib\piggybank\java\piggybank.jar; 
DEFINE MULTISTORAGE org.apache.pig.piggybank.storage.MultiStorage(); 
a = LOAD'/part' USING PigStorage(',') AS (uuid:chararray,timestamp:chararray,Name:chararray,EmailID:chararray,CompanyName:chararray,Location:chararray); 
STORE a  into '/output/multistorage' USING MULTISTORAGE('/output/multistorage','2', 'none', ',');

You are then partitionnig by Name.

这篇关于猪的MultiStorage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆