sande
sande

Reputation: 664

How to drop External_Table along with Metadata and Data in Hive

I have lot of tables in my database, some of them are External_Tables, every time when I drop my External_Table, I need to find the location of the External_Table and I need to -rm -r the data.So,Is there any way in hive, to drop External_Table with both Metadata and Data at once like, if we drop the managed_table both data and metadata will be dropped.

Upvotes: 0

Views: 125

Answers (1)

David דודו Markovitz
David דודו Markovitz

Reputation: 44951

Turn the external table to a managed table before dropping it

alter table mytable set tblproperties ('EXTERNAL'='FALSE');

Upvotes: 1

Related Questions