Databases are logical containers for a group of tables, and each database defines a separate namespace.
Creating a database is a lightweight operation. There are minimal
database-specific properties to configure, such as
change the owner of a database with the
Typically, you create a separate database for each project or application, to avoid naming conflicts between tables and to make clear which tables are related to each other.
USE statement lets you switch between databases.
Unqualified references to tables, views, and functions refer to objects
within the current database. You can also refer to objects in other
databases by using qualified names of the form
Each database is physically represented by a directory in HDFS.
When you do not specify a
LOCATION attribute, the
directory is located in the Impala data directory with the associated
tables managed by Impala. When you do specify a
LOCATION attribute, any read and write operations for
tables in that database are relative to the specified HDFS directory.
By default, you use the
defaultdatabase when you connect to Impala. Tables created in the
defaultdatabase are physically located at one level higher in HDFS than all the user-created databases.
All Impala built-in functions reside in this database.