Friday, August 16, 2019

Hive - Drop Table

Hive facilitates us to drop a table by using the SQL drop table command. Let's follow the below steps to drop the table from the database.
  • Let's check the list of existing databases by using the following command: -
  1. hive> show databases;  

Hive Drop Table
  • Now select the database from which we want to delete the table by using the following command: -
  1. hive> use demo;  

Hive Drop Table
  • Let's check the list of existing tables in the corresponding database.
  1. hive> show tables;  

Hive Drop Table
  • Now, drop the table by using the following command: -
  1. hive> drop table new_employee;   

Hive Drop Table
  • Let's check whether the table is dropped or not.
  1. hive> show tables;  

Hive Drop Table
As we can see, the table new_employee is not present in the list. Hence, the table is dropped successfully.

No comments:

Post a Comment

Lab 09: Publish and subscribe to Event Grid events

  Microsoft Azure user interface Given the dynamic nature of Microsoft cloud tools, you might experience Azure UI changes that occur after t...