"不是文件"成功插入后选择异常

时间:2015-06-01 17:58:24

标签: hive hdinsight

我创建了一个表:

DROP TABLE IF EXISTS sampleout;

CREATE EXTERNAL TABLE sampleout(
    id bigint,
    LNG FLOAT,
    LAT FLOAT,
    GMTDateTime TIMESTAMP,
    calculatedcolumn FLOAT
    )

ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS TEXTFILE LOCATION 'wasb://sampleout@xxxxxx.blob.core.windows.net/';

然后我从这个查询中获得了成功:

INSERT into TABLE   sampleout  select *, 0 as calculatedcolumn from sampletable

sampleoutsampletable相同,但额外的列calculatedcolumn除外。成功插入后,我打开blob存储并打开文本文件以验证数据是否在指定的文本文件位置。

...然而

select * from sampleout limit 10

返回以下错误:

Logging initialized using configuration in file:/C:/apps/dist/hive-0.13.0.2.1.12.1-0003/conf/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/apps/dist/hadoop-2.4.0.2.1.12.1-0003/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/apps/dist/hbase-0.98.0.2.1.12.1-0003-hadoop2/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
OK
Failed with exception java.io.IOException:java.io.IOException: Not a file: wasb://sampleout@xxxxxx.blob.core.windows.net/hive
Time taken: 3.032 seconds

我怎样才能成功插入,但无法从表中选择?请注意,错误显示' / hive'添加到create。

中指定的文本文件位置

1 个答案:

答案 0 :(得分:0)

基本上,不要将TEXTFILE LOCATION放在根目录下。即使它是blob存储(没有真正的文件夹),HDFS或其他东西所需的结构也希望你在该位置使用至少一个子文件夹。

移动

wasb://sampleout@xxxxxx.blob.core.windows.net/

wasb://sampleout@xxxxxx.blob.core.windows.net/somefolder/

解决了这个问题。信用:https://stackoverflow.com/users/4951010/andrew-moll

相关问题