This is the documentation for Impala 2.1.x, included as part of CDH 5.3.x.
Latest Version of this Page | All Cloudera Docs

DROP DATABASE Statement

Removes a database from the system, and deletes the corresponding *.db directory from HDFS. The database must be empty before it can be dropped, to avoid losing any data.

Syntax:

DROP (DATABASE|SCHEMA) [IF EXISTS] database_name;

Statement type: DDL

Usage notes:

Before dropping a database, use a combination of DROP TABLE, DROP VIEW, ALTER TABLE, and ALTER VIEW statements, to drop all the tables and views in the database or move them to other databases.

Hive considerations:

When you drop a database in Impala, the database can no longer be used by Hive.

Examples:

See CREATE DATABASE Statement for examples covering CREATE DATABASE, USE, and DROP DATABASE.

Cancellation: Cannot be cancelled.

HDFS permissions:

The user ID that the impalad daemon runs under, typically the impala user, must have write permission for the directory associated with the database.

Overview of Impala Databases, CREATE DATABASE Statement, USE Statement, SHOW DATABASES

Page generated September 15, 2016.