The database in Hive describes a collection of tables that are used for a similar purpose or belong to the same groups. If the database is not specified, the default database is used. Whenever a new database is created, Hive creates a directory for each database at
/user/hive/warehouse, defined in
hive.metastore.warehouse.dir. For example, the
myhivebook database is located at
/user/hive/datawarehouse/myhivebook.db. However, the default database doesn't have its own directory. The following is the core DDL for Hive databases:
jdbc:hive2://> CREATE DATABASE myhivebook;
jdbc:hive2://> CREATE DATABASE ...