- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
getting error when trying to deilimit the rows of data using pigStorage('|')
- Labels:
-
Apache Pig
Created on ‎07-28-2017 08:11 AM - edited ‎09-16-2022 05:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>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
Created ‎07-28-2017 12:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Created ‎07-28-2017 11:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
Created ‎07-28-2017 12:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Created ‎07-28-2017 12:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
