Section 6:55. Retrieve Metadata of Hive Tables using Describe(Extended and Formatted)

In Hive, you can use the DESCRIBE command to retrieve metadata about a table. The DESCRIBE command provides information about the columns in the table, their data types, and other properties.

You can use two different variants of the DESCRIBE command in Hive to get the metadata of a table, which are:

  1. DESCRIBE EXTENDED – This variant of the DESCRIBE command provides more detailed information about the table, including its properties, storage information, and more.

  DESCRIBE EXTENDED table_name;

Replace table_name with the name of the table you want to describe. This command will display detailed information about the table, including its properties, storage information, and more.

  1. DESCRIBE FORMATTED – This variant of the DESCRIBE command provides a more structured output format that can be easier to read and analyze.

DESCRIBE FORMATTED table_name;

Replace table_name with the name of the table you want to describe. This command will display the metadata of the table in a structured format that includes information about the columns, data types, and other properties.

Both DESCRIBE EXTENDED and DESCRIBE FORMATTED can be useful for understanding the structure of a table and its associated metadata. Depending on your use case, you may find one variant more helpful than the other.

Share this post