Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

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