2013-11-22 45 views
0

我試圖以僞分佈式模式運行配置單元腳本。當我運行交互模式時,腳本中的命令運行得非常好。但是,當我在腳本中添加所有這些命令並運行時,出現錯誤。以僞分佈式模式運行配置單元腳本時出錯

腳本:

add jar /path/to/jar/file; 
    create table flights(year int, month int,code string) row format serde 'com.bizo.hive.serde.csv.CSVSerde'; 
    load data inpath '/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv' overwrite into table flights; 

的 'On_Time_On_Time_Performance_2013_1.csv' 並不在HDFS存在。我得到的錯誤是:

FAILED: SemanticException Line 3:17 Invalid path ''/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv'': No files matching path hdfs://localhost:54310/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv 

    fs.default.name=hdfs://localhost:54310 

我的hadoop運行良好。

有人可以給任何指針?

謝謝。

回答

0

這不是一個真正的答案,但它是一個更詳細和可重複的問題。

一)一個人需要從這裏下載的CSV-SERDE:混帳克隆https://github.com/ogrodnek/csv-serde

b)使用MVN包 Ç構建它)創建一個包含對應的三個字段有三個逗號分隔的字段的文本文件給定表格。 c)如果路徑是說「/共享」,那麼以下是正確的順序加載:

add jar /shared/csv-serde/target/csv-serde-1.1.2-0.11.0-all.jar; 
drop table if exists flights; 
create table flights(year int, month int,code string) row format serde 'com.bizo.hive.serde.csv.CSVSerde' stored as textfile; 
load data inpath '/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv' overwrite into table flights; 

我看到了同樣的錯誤作爲OP:失敗:2:17 SemanticException線的路徑無效「 '/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv'':沒有匹配路徑的文件hdfs:// localhost:9000/tmp/hive-user/On_Time_On_Time_Performance_2013_1.csv

相關問題