Deleting a Table
Function
This statement is used to delete tables.
Syntax
1 | DROP TABLE [IF EXISTS] [db_name.]table_name;
|
Keyword
- If the table is stored in OBS, only the metadata is deleted. The data stored on OBS is not deleted.
- If the table is stored in DLI, the data and the corresponding metadata are all deleted.
Precautions
The to-be-deleted table must exist in the current database. Otherwise, an error is reported. To avoid this error, add IF EXISTS in this statement.
Example
To delete a table named student in the current database, run the following statement:
1 | DROP TABLE IF EXISTS student;
|
Last Article: Creating a DLI Table Using the Hive Syntax
Next Article: Viewing Tables
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.