2013-11-22 46 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

相关问题