Dropping Tables and Databases in Hive


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

Practice hive on state of the art Big Data cluster - https://labs.itversity.com
You can sign up for our courses on Udemy using $10 coupons - Udemy Coupons - Big Data Courses