猪中的多存储 [英] MultiStorage in pig

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

问题描述

我已经在 grunt shell 中运行了下面的 pig 脚本

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', ',');

运行时报错如下

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.]

有人可以帮我吗?

推荐答案

您没有按照日志要求导入您的函数.如果您确实可以访问该 jar,您可以尝试以下代码(缺少一行):

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.

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

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