1
votes

I have created hive table loading data from another table when i execute the query its starting but dint produce any results

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

OK Time taken: 0.188 seconds

INSERT OVERWRITE TABLE fact_orders1 SELECT * FROM fact_orders;

Query ID = hadoop_20151230051654_78edfb70-4d41-4fa7-9110-fa9a98d5405d Total jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_1451392201160_0007, Tracking URL = http://localhost:8088/proxy/application_1451392201160_0007/ Kill Command = /home/hadoop/hadoop-2.6.1/bin/hadoop job -kill job_1451392201160_0007

1

1 Answers

0
votes

You have no output from query because there is no data stored in it. I assume you use default metastore under /user/hive/warehouse so what you need to do is:

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

That should work.

Also edit your query for table creation adding the LOCATION statement:

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;

In case if you want to use the data outside the hive metastore you need to use external tables