Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
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

avatar
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).

View solution in original post

3 REPLIES 3

avatar
Super Collaborator

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

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

avatar
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).