View Materialized View Structure (DESC MATERIALIZED VIEW)

Description

The DESC command is used to view the column structure of a materialized view, including field names, data types, and comments. DESC EXTENDED can further display detailed metadata of the materialized view, such as creation time, query definition, source table information, and more.

For more details, see Materialized View.

Syntax

DESC [EXTENDED] [schema_name.]<mv_name>

Parameter Description

ParameterRequiredDescription
EXTENDEDNoDisplay extended information, including materialized view metadata, query definition, source tables, and other details
schema_nameNoThe name of the schema. If not specified, the current schema is used by default
mv_nameYesThe name of the materialized view to view

Return Column Description

Basic Mode (without EXTENDED)

Column NameDescription
column_nameColumn name
data_typeData type
commentColumn comment

Extended Mode (with EXTENDED)

After the basic column information, the following metadata rows are also returned:

FieldDescription
workspaceWorkspace name
schemaSchema name
nameMaterialized view name
creatorCreator
created_timeCreation time
last_modified_timeLast modified time
typeObject type, value is MATERIALIZED VIEW
view_textThe full query statement of the materialized view (with schema prefix)
view_original_textThe original query statement of the materialized view
is_materializedWhether it has been materialized, value is true
source_tablesList of dependent source tables
formatStorage format, e.g., PARQUET
statisticsData statistics (row count and bytes)

Examples

Example 1: View the column structure of a materialized view

DESC doc_test.mv_test_sales;

Result:

+-------------+-----------+---------+ | column_name | data_type | comment | +-------------+-----------+---------+ | id | int | | | name | string | | +-------------+-----------+---------+

Example 2: View extended information of a materialized view

DESC EXTENDED doc_test.mv_test_sales;

Result (partial):

+------------------------------+------------------------------------------+---------+ | column_name | data_type | comment | +------------------------------+------------------------------------------+---------+ | id | int | | | name | string | | | | | | | # detailed table information | | | | workspace | quick_start | | | schema | doc_test | | | name | mv_test_sales | | | creator | qiliang | | | type | MATERIALIZED VIEW | | | view_original_text | SELECT id, name FROM doc_test.employees; | | | is_materialized | true | | | format | PARQUET | | | statistics | 5 rows 2610 bytes | | +------------------------------+------------------------------------------+---------+

Notes

  • DESC is equivalent to DESCRIBE; the two can be used interchangeably.
  • The DESC syntax for materialized views is the same as for regular tables. See DESC TABLE for details.
  • The source_tables field returned by DESC EXTENDED records all source tables that the materialized view depends on, which can be used for data lineage analysis.