Let us understand how to DROP tables in Hive.
- We can use DROP TABLE command to drop the table… Let us drop tables orders as well as orders_stage.
DROP TABLE orders; DROP TABLE orders_stage;
- DROP TABLE on managed table will delete both metadata in metastore as well as data in HDFS, while DROP TABLE on external table will only delete metadata in metastore.
- We can drop database by using DROP DATABASE Command. However we need to drop all the tables in the database first.
- Here is the example to drop the database training_retail -
DROP DATABASE training_retail