PIG: ERROR 1000: Error during parsing

brain storm picture brain storm · Jul 1, 2014 · Viewed 14.6k times · Source

I have installed Pig 0.12 in my machine. when I run

darwin$ pig
grunt> ls /data/
hdfs://Nmame:10001/data/pg20417.txt<r 3>    674570
hdfs://Nname:10001/data/pg4300.txt<r 3> 1573150
hdfs:/Nname:10001/data/pg5000.txt<r 3>  1423803
hdfs://Nname:10001/data/weather <dir>

but when I try to create a query, I get the following error:

grunt> book = load '/data/pg4300.txt' as (lines:chararray);
2014-06-30 17:40:08,939 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <PATH> "book=load "" at line 2, column 1.
Was expecting one of:
    <EOF> 
    "cat" ...
    "clear" ...
    "fs" ...
    "sh" ...
    "cd" ...
    "cp" ...
    "copyFromLocal" ...
    "copyToLocal" ...
    "dump" ...
    "\\d" ...
    "describe" ...
    "\\de" ...
    "aliases" ...
    "explain" ...
    "\\e" ...
    "help" ...
    "history" ...
    "kill" ...
    "ls" ...
    "mv" ...
    "mkdir" ...
    "pwd" ...
    "quit" ...
    "\\q" ...
    "register" ...
    "rm" ...
    "rmf" ...
    "set" ...
    "illustrate" ...
    "\\i" ...
    "run" ...
    "exec" ...
    "scriptDone" ...
    "" ...
    "" ...
    <EOL> ...
    ";" ...

Details at logfile: /Users/Documents/pig_1404175088198.log

I tried changingload to LOAD and as to AS but nothing worked.

Answer

Dhanesh picture Dhanesh · Feb 17, 2015

I ran into the same issue and was looking for a solution. Turns out this happens if you do not give space. book=load will give you an error. book = load will work. I am not sure if this is an expected behavior.