error 1000:解析期间出错遇到

kmb7vmvb  于 2021-06-02  发布在  Hadoop
关注(0)|答案(1)|浏览(376)

我在咕噜咕噜里用这个:

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

有人能告诉我怎么修改剧本吗?
非常感谢你。

pbwdgjma

pbwdgjma1#

在等号前后加空格。

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

相关问题