The database

DBS

Database information, which records the name, Location, and description of the database

The column name describe The sample data
DB_ID The database ID 1
DESC Database Description Default Hive database
DB_LOCATION_URI The database Location viewfs://……
NAME The database name default
OWNER_NAME The database owner public
OWNER_TYPE The owner type ROLE

table

TBLS

Hive table information: Records the name and type of the table

Foreign keys:

  • DB_ID: Associated DBS
  • SD_ID: associated SDS
The column name describe The sample data
TBL_ID Table ID 1
CREATE_TIME Create time, ten digit timestamp 1494310346
DB_ID The database ID 1
LAST_ACCESS_TIME Last access time, ten digit timestamp 1494310346
OWNER Table owner hive
RETENTION Keep field 0
SD_ID Column related information foreign key 1
TBL_NAME The name of the table xxxxxx
TBL_TYPE Table type The value can be MANAGED_TABLE, EXTERNAL_TABLE, INDEX_TABLE, or VIRTUAL_VIEW
VIEW_EXPANDED_TEXT View extension SQL VIEW_ORIGINAL_TEXT specifies the VIEW_ORIGINAL_TEXT
VIEW_ORIGINAL_TEXT View raw SQL Select * from library name. The name of the table
IS_REWRITE_ENABLED Whether the table is rewritable

Fields and Storage

SDS

Table storage information, and COLUMNS_V2 can be associated to obtain table field information

Foreign keys:

  • CD_ID: COLUMNS_V2
  • SERDE_ID: Indicates the associated SERDES
The column name describe The sample data
SD_ID Storage Information ID 1
CD_ID Field ids 1
INPUT_FORMAT The input_format class that reads table data org.apache.hadoop.mapred.TextInputFormat
IS_COMPRESSED Whether the compression 0
IS_STOREDASSUBDIRECTORIES Whether to store in a subdirectory 0
LOCATION List the Location viewfs://……
NUM_BUCKETS Points bucket number 0
OUTPUT_FORMAT The output_format class that writes table data org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
SERDE_ID Serialized class ID 1

COLUMNS_V2

Table of the field

The column name describe The sample data
CD_ID Field ids 1
COMMENT The field The name of the
COLUMN_NAME The field names name
TYPE_NAME The field type string
INTEGER_IDX Index of a field in a table 0

SERDES

Stores the associated serialized classes

The column name describe The sample data
SERDE_ID Serialized class ID 1
NAME The name of the
SLIB Class Fully qualified name org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

partition

PARTITIONS

Partition information for a table

Foreign keys:

  • SD_ID: Associated SDS. Each partition has an independent SDS record
  • TBL_ID: Associated TBLS
The column name describe The sample data
PART_ID The partition id 1
CREATE_TIME Partition creation time, ten – digit timestamp 1494310346
LAST_ACCESS_TIME Last access time, ten digit timestamp 1494310346
PART_NAME The name of the partition Partition field = partition value
SD_ID Storage Information ID 1
TBL_ID Table id 1

PARTITION_KEYS

Partition field of the Hive table

The column name describe The sample data
TBL_ID Table id 1
PKEY_COMMENT Partition field Description
PKEY_NAME Partition field name
PKEY_TYPE Partition field type string
INTEGER_IDX Partition field INDEX 0

PARTITION_KEY_VALS

The value of the partition field

The column name describe The sample data
PART_ID The partition id 1
PART_KEY_VAL The value of the partition field
INTEGER_IDX The corresponding partition field index 0

If a partition has two partition fields: type and subType, where type is the first partition field and the index is 0

And there is a partition type=’ home appliance ‘/subType=’ TV ‘, the table will have the following records

PART_ID PART_KEY_VAL INTEGER_IDX
xxx Home appliance 0
xxx The TV 1

Custom function

FUNCS

The column name describe The sample data
FUNC_ID The function id 1
CLASS_NAME Fully qualified name of the function class com.xiaoke.HelloWorld
CREATE_TIME Create time, ten digit timestamp 1599547311
DB_ID Id of the owning database of the function 1
FUNC_NAME The name of the function hello_world
FUNC_TYPE Function types 1
OWNER_NAME The function owner hive
OWNER_TYPE The owner type USER

FUNC_RU

The column name describe The sample data
FUNC_ID The function id 1
RESOURCE_TYPE The resource type 1
RESOURCE_URI Resource uris hdfs://…
INTEGER_IDX

Some property sheets

DATABASE_PARAMS

Database properties

The column name describe The sample data
DB_ID The database ID 1
PARAM_KEY Key attributes
PARAM_VALUE Attribute values

TABLE_PARAMS

Hive table properties

The column name describe The sample data
TBL_ID Table ID 1
PARAM_KEY Key attributes
PARAM_VALUE Attribute values

PARAM_KEY:

  • EXTERNAL: Indicates whether the table is EXTERNAL
  • Comment: Table description
  • TotalSize: indicates the table size
  • NumRows: Number of table records

SD_PARAMS

The column name describe The sample data
SD_ID Storage Information ID 1
PARAM_KEY Key attributes
PARAM_VALUE Attribute values

SERDE_PARAMS

Serialized property

The column name describe The sample data
SERDE_ID Serialized class ID 1
PARAM_KEY Key attributes
PARAM_VALUE Attribute values

PARTITION_PARAMS

The partition properties

The column name describe The sample data
PART_ID The partition id 1
PARAM_KEY Key attributes
PARAM_VALUE Attribute values