Reputation: 6332
I would ask if there is a sql command in hive to drop the table and delete the files on hdfs for this external table.
When I use hdfs command to delete the files, I am always afraid that I may delete other files that doesn't belong to this external table.
Upvotes: 0
Views: 271
Reputation: 1642
There is no such sql command to drop external table directly but there is an alternative
Step 1 :
ALTER TABLE <table-name> SET TBLPROPERTIES('EXTERNAL'='False');
Step 2 :
drop table <table-name>; //now the table is internal if you drop the table data will be dropped automatically.
Upvotes: 2