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
Parameter Description
| Parameter | Required | Description |
|---|---|---|
EXTENDED | No | Display extended information, including materialized view metadata, query definition, source tables, and other details |
schema_name | No | The name of the schema. If not specified, the current schema is used by default |
mv_name | Yes | The name of the materialized view to view |
Return Column Description
Basic Mode (without EXTENDED)
| Column Name | Description |
|---|---|
column_name | Column name |
data_type | Data type |
comment | Column comment |
Extended Mode (with EXTENDED)
After the basic column information, the following metadata rows are also returned:
| Field | Description |
|---|---|
workspace | Workspace name |
schema | Schema name |
name | Materialized view name |
creator | Creator |
created_time | Creation time |
last_modified_time | Last modified time |
type | Object type, value is MATERIALIZED VIEW |
view_text | The full query statement of the materialized view (with schema prefix) |
view_original_text | The original query statement of the materialized view |
is_materialized | Whether it has been materialized, value is true |
source_tables | List of dependent source tables |
format | Storage format, e.g., PARQUET |
statistics | Data statistics (row count and bytes) |
Examples
Example 1: View the column structure of a materialized view
Result:
Example 2: View extended information of a materialized view
Result (partial):
Notes
DESCis equivalent toDESCRIBE; the two can be used interchangeably.- The
DESCsyntax for materialized views is the same as for regular tables. See DESC TABLE for details. - The
source_tablesfield returned byDESC EXTENDEDrecords all source tables that the materialized view depends on, which can be used for data lineage analysis.
Related Commands
- DESC TABLE: View regular table structure
- SHOW TABLES WHERE is_materialized_view=true: List all materialized views
- REFRESH MATERIALIZED VIEW: Refresh a materialized view
