In this article, you will learn how to list out the properties of a database or a table in Hive.
DATABASE LEVEL:
DESCRIBE DATABASE db_name;
DESCRIBE SCHEMA db_name;
Database or schema both are the same thing. These words can be used interchangeably.
DESCRIBE DATABASE EXTENDED db_name;
Use the above command to list all the database properties attached to a particular database in Hive.
TABLE LEVEL:
DESC TableName
DESCRIBE TableName
Use the above command to get the schema of the table.
DESC EXTENDED TableName
Use the above command to get detailed information about the table that includes comments, last modified date, etc along with the table's definition.
DESC FORMATTED TableName
Use the above command to get the summary, details, and formatted information about the specified table.