Describe table metadata feature
You can use certain Hive and Impala show and describe commands to get information about table metadata. You can also query metadata tables.
The following table lists SHOW and DESCRIBE commands supported by Hive and Impala.
Command Syntax | Description | SQL Engine Support |
---|---|---|
SHOW CREATE TABLE table_name |
Reveals the schema that created the table. | Hive and Impala |
SHOW FILES IN table_name |
Lists the files related to the table. | Impala |
SHOW PARTITIONS table_name |
Returns the Iceberg partition spec, just the column information, not actual partitions or files. | Impala |
|
The optional EXTENDED shows all the metadata for the table in Thrift serialized form, which is useful for debugging. | Hive and Impala |
|
The optional FORMATTED shows the metadata in tabular format. | Hive |
|
Optionally limits the output history to a period of time. | Impala |
Hive example
DESCRIBE t;
Hive output includes the following information:
col_name | data_type | comment |
---|---|---|
x | int | |
y | int | |
NULL | NULL | |
# Partition Transform Information | NULL | NULL |
# col_name | transform_type | NULL |
y | IDENTITY | NULL |
The output of DESCRIBE HISTORY includes the following columns about the snapshot. The first
three are self-explanatory. The is_current_ancestor column value is TRUE if the snapshot is the
ancestor of the table:
- creation_time
- snapshot_id
- parent_id
- is_current_ancestor
Impala examples
DESCRIBE HISTORY ice_t FROM '2022-01-04 10:00:00';
DESCRIBE HISTORY ice_t FROM now() - interval 5 days;
DESCRIBE HISTORY ice_t BETWEEN '2022-01-04 10:00:00' AND '2022-01-05 10:00:00';