2015-12-30 54 views
1

我已經創建了蜂巢表加載數據時,我執行查詢它的起始,但力產生任何結果蜂巢查詢不從另一臺正常工作

CREATE TABLE fact_orders1 (order_number String, created timestamp, last_upd timestamp) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS ORC; 

OK耗時:0.188秒

INSERT OVERWRITE TABLE fact_orders1 SELECT * FROM fact_orders; 

查詢ID = hadoop_20151230051654_78edfb70-4d41-4fa7-9110-fa9a98d5405d 合計作業= 1個下水工作1出的reduce任務1號的設置 爲0,因爲沒有降低運營商開始工作= job_1451392201160_0007,跟蹤URL = http://localhost:8088/proxy/application_1451392201160_0007/殺 命令= /home/hadoop/hadoop-2.6.1/bin/hadoop工作 - 殺 job_1451392201160_0007

回答

0

您有沒有從查詢輸出,因爲沒有數據存放在裏面。我假設你使用默認metastore /user/hive/warehouse下,所以你需要做的是:

LOAD DATA LOCAL INPATH '/path/on/hdfs/to/data' OVERWRITE INTO TABLE fact_orders1; 

這應該工作。

還可以編輯查詢表創建添加LOCATION聲明:

CREATE TABLE fact_orders1 (order_number String, created timestamp, last_upd timestamp) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
STORED AS ORC 
LOCATION /user/hive/warehouse/fact_orders1; 

在情況下,如果你想使用metastore你需要使用external tables

蜂巢外的數據