1. Hive Database
We look at the database information in the hive terminal, we can see that hive has a default database, and we also know that the hive database corresponds to a directory above the HDFs, then the default database defaults to which directory? We can see the information through a HIVE.METASTORE.WAREHOUSE.DIR configuration item in hive configuration file Hive-site.xml.
For example, it tells us the default database in the HDFs directory.
In our Metastore, we can refer to the table DBS to learn the correspondence.
2. Hive Table
View all databases:
Use Kong for this database:
CREATE TABLE: For a simple example, CREATE TABLE t1 (id int);
View all tables: show tables;
View table structure: desc t1;
View the details of the table: Desc extended t1;
View the table creation information: show create table T1;
Location of the table in HDFs:
Table in meta-data metastore:
The correspondence between database, table, data and HDFs in hive