2016-06-12 25 views
1

に遭遇した私はうなり声シェルでこれを使用しています:hadoop:ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1000:解析中にエラーが発生しました。

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

データはここにある:

[[email protected] 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> ... 
    ";" ... 

誰でも私にスクリプトを修正する方法を教えてもらえますか?

ありがとうございました。

+0

シェルからブタスクリプトを実行しようとしたようです。 'pig -f script.pig'ではなく –

+0

gruntシェルを使用している場合は、' grunt> ' –

答えて

1

等号の前後にスペースを追加します。

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

と表示されたときにそのロードコマンドを入力できます。 – mdivk

関連する問題