The correspondence between database, table, data and HDFs in hive

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.