hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sukhendu Chakraborty <>
Subject removing hdfs table data directory does not throw error in hive
Date Tue, 24 Apr 2012 00:55:27 GMT
I have a hive table tab3 with two columns (c1 int, c2 int)

hive> load data local inpath '/tmp/orhc466fb981' into table tab3;
Copying data from file:/tmp/orhc466fb981
Copying file: file:/tmp/orhc466fb981
Loading data to table default.tab3
Time taken: 3.907 seconds
hive> select * from tab3;
4       2
4       10
7       4
7       22
//remove the tab3 directory from hdfs
[schakrab@diy-1-2 orch]$ hadoop fs -rmr /user/hive/warehouse/tab3;
Deleted hdfs://localhost:9000/user/hive/warehouse/tab3
[schakrab@diy-1-2 orch]$ hive
Hive history file=/tmp/schakrab/hive_job_log_schakrab_201204231748_1985146177.txt
//no error thrown!
hive> select * from tab3;
Time taken: 3.68 seconds
// of course. metadata still exists.
hive> desc tab3;
c1      int
c2      int
Time taken: 0.127 seconds

// doing another load recreates the directory tab3

Shouldn't the select * query return an error when the underlying table
file is removed ?


View raw message