Quicktostudy
11/18/2018   
Hive Tutorial
Home »  Hive » Hive Drop Database

Hive Drop Database<


Drop the empty database

hive> DROP DATABASE IF EXISTS mydatabase;

Note that Hive keeps the database and the table in directory mode. In order to remove the parent directory, we need to remove the subdirectories first. By default, the database cannot be dropped if it is not empty, unless CASCADE is specified. CASCADE drops the tables in the database automatically before dropping the database.

Drop the database with CASCADE

hive> DROP DATABASE IF EXISTS mydatabase CASCADE;

Alter the database properties. The ALTER DATABASE statement can only apply to the table properties and roles (Hive 0.13.0 and later) on the table. The other metadata about the database cannot be changed

hive> ALTER DATABASE myhivebook
> SET DBPROPERTIES ('edited-by' = 'quicktostudy');

Contact Us| About Us| Terms| Privacy Policies
Powered by Lorquins Technologies© 2017 QuickToStudy.com. All Rights Reserved