Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting out with pig

Tags:

apache-pig

I just started with pig and a simple line of code that is supposed to read in data from a file called mary-

input = load 'mary' as (line);

is not working for me. I have this file in the folder from where I ran pig and this is the error I get -

Grunt - ERROR 1200: <line 1, column 0>  mismatched input 'input' expecting EOF

This piece of code was taken from the first example of the book Programming_Pig.

like image 707
Rohit Pandey Avatar asked Mar 20 '26 22:03

Rohit Pandey


1 Answers

Using the name input for a relation does not work as it is a reserved keyword in pig. Use another name for the relation such as

A = load 'mary' as (line);

and it will work.

My guess is that the version that was used for "Programming Pig" did not yet have this reserved keyword or it is simply wrong.

like image 173
Frederic Avatar answered Mar 24 '26 16:03

Frederic