Rohit Pandey
Rohit Pandey

Reputation: 2681

Error starting out with 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.

Upvotes: 3

Views: 3016

Answers (1)

Frederic
Frederic

Reputation: 3284

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.

Upvotes: 9

Related Questions