使用sparksql执行load

时间:2016-12-28 11:15:59

标签: scala hadoop apache-spark apache-spark-sql

我在hdfs中有textfile val.txt我想使用SparkSQL。所以我打开了火花壳并宣称:

sqlContext.sql("CREATE TABLE val(code string,description string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ';' STORED AS TextFile")
sqlContext.sql("LOAD DATA INPATH 'hdfs://localhost:9000/val.txt' OVERWRITE INTO TABLE val")

该表已创建,但我得到了:

Failure:SemanticException[Error 10028]: Line 1:17 is  not legal 'hdfs://localhost:9000/val.txt:Move from ;hdfs//localhost:9000/val.txt to file:/user/hive/hive/warehouse/val is not valid .Please check that values for params "default.fs.name" and"hive.metastore.warehouse.dir" do  not.

0 个答案:

没有答案