Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

getting error when trying to deilimit the rows of data using pigStorage('|')

Solved Go to solution

getting error when trying to deilimit the rows of data using pigStorage('|')

New Contributor
>>lp = load '/employee.txt ' using pigStorage('|') as (aa,bb,cc,dd,ee);

And error is like above

2017-07-27 22:16:48,830 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve pigStorage using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.] Details at logfile: /root/Desktop/pig_1501174002903.log

1 ACCEPTED SOLUTION

Accepted Solutions

Re: getting error when trying to deilimit the rows of data using pigStorage('|')

Guru

@Aditya Jadhav

Small mistake: you need uppercase PigStorage('|').

lp = load '/employee.txt ' using PigStorage('|') as (aa,bb,cc,dd,ee);

Error shows that it is looking for a java function called pigStorage and cannot find it. In addition to Pig's native functions (which PigStorage belongs) functions can be found in referenced libraries (e.g. 3rd party or ones you build yourself as User Defined Functions).

3 REPLIES 3
Highlighted

Re: getting error when trying to deilimit the rows of data using pigStorage('|')

Expert Contributor

We generally encounter such errors when the delimiter specified in command doesn't match the delimiter in input file. Also make sure you are giving complete and right path of file

Please try below syntax

load '/path_to_file' using PigStorage('|') as (aa,bb,cc,dd,ee);

Re: getting error when trying to deilimit the rows of data using pigStorage('|')

Guru

One point: if you specify a delimiter that is not the true delimiter in the file ... no error will be thrown. Rather, it will treat the full record (including its true delimiters) as a single field. In this case, the true delims will just be characters in a string.

Re: getting error when trying to deilimit the rows of data using pigStorage('|')

Guru

@Aditya Jadhav

Small mistake: you need uppercase PigStorage('|').

lp = load '/employee.txt ' using PigStorage('|') as (aa,bb,cc,dd,ee);

Error shows that it is looking for a java function called pigStorage and cannot find it. In addition to Pig's native functions (which PigStorage belongs) functions can be found in referenced libraries (e.g. 3rd party or ones you build yourself as User Defined Functions).

Don't have an account?
Coming from Hortonworks? Activate your account here