mdivk
mdivk

Reputation: 3727

hadoop: ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered

I am using this in my grunt shell:

customers=LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);

the data is here:

[root@localhost bin]# hdfs dfs -cat hdfs://localhost:9000/pig_data_customers
1,Ramesh,32,Ahmedabad,2000.00
2,Khilan,25,Delhi,1500.00
3,kaushik,23,Kota,2000.00
4,Chaitali,25,Mumbai,6500.00 
5,Hardik,27,Bhopal,8500.00
6,Komal,22,MP,4500.00
7,Muffy,24,Indore,10000.00

I am getting error when I run:

customers=LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);

Here is the error message:

2016-06-12 17:35:11,954 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000: Error during parsing. Encountered " <PATH> "customers=LOAD "" at line 1, 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" ...
    "%default" ...
    "%declare" ...
    "scriptDone" ...
    "" ...
    "" ...
    <EOL> ...
    ";" ...

Can anyone tell me how do I fix the script?

Thank you very much.

Upvotes: 1

Views: 3407

Answers (1)

Mikko Kupsu
Mikko Kupsu

Reputation: 371

Add space before and after the equals sign.

customers = LOAD 'hdfs://localhost:9000/pig_data_customers' USING PigStorage(',')as (id:int, name:chararray, age:int, address:chararray, salary:double);

Upvotes: 1

Related Questions