hadoop:ERROR org.apache.pig.tools.grunt.Grunt - 错误1000:解析期间出错。遇到

时间:2016-06-12 22:18:54

标签: hadoop apache-pig

我在我的咕噜声中使用它:

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

数据在这里:

[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

我跑步时遇到错误:

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

以下是错误消息:

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> ...
    ";" ...

有谁能告诉我如何修复脚本?

非常感谢。

1 个答案:

答案 0 :(得分:1)

在等号前后添加空格。

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