MultiStorage in pig

孤者浪人 提交于 2019-12-11 09:59:48

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/33497182/multistorage-in-pig

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!