DESCRIBE SEMANTIC VIEW¶
描述构成 语义视图 的逻辑表、维度、事实和指标的属性。
- 另请参阅:
CREATE SEMANTIC VIEW , ALTER SEMANTIC VIEW , DROP SEMANTIC VIEW , SHOW SEMANTIC VIEWS , SHOW SEMANTIC DIMENSIONS , SHOW SEMANTIC DIMENSIONS FOR METRIC , SHOW SEMANTIC FACTS , SHOW SEMANTIC METRICS
语法¶
参数¶
name指定要描述的语义视图的标识符。
如果标识符包含空格或特殊字符,则整个字符串必须放在双引号内。放在双引号内的标识符也区分大小写。
有关更多信息,请参阅 标识符要求。
输出¶
命令输出提供有关逻辑表、关系、事实、维度、指标和语义视图本身的属性和元数据。
视图中的每行代表以下内容的属性:
逻辑表
关系
事实
维度
指标
语义视图本身
以下是该命令的输出示例:
如上所示,每行代表逻辑表、维度、关系、指标或事实的属性。例如:
第一行是语义视图本身
comment属性的值。第二行是名为
customers的逻辑表base_table_database_name属性的值。
该视图包括以下各列:
列 |
描述 |
|---|---|
|
具有该行属性的对象的类型。值可以是以下其中一项:
|
|
具有此行属性的维度、事实、指标、逻辑表或关系的名称。 For rows that represent properties of the semantic view itself and rows that represent custom instructions, the value in this column is NULL. |
|
维度、事实、指标或关系的父实体的名称。 The value of this column is NULL for rows that represent:
|
|
Name of the property of the logical table, constraint, relationship, dimension, fact, metric, custom instruction, or semantic view. 此列中的值取决于对象的类型 ( 请参阅以下部分,根据
|
|
Value of the property of the logical table, relationship, dimension, fact, metric, custom instruction, or semantic view. |
逻辑表的属性¶
如果 object_kind 列包含 TABLE,则 property 列可能包含以下值:
Properties for constraints¶
If the object_kind column contains CONSTRAINT, the row represents a constraint that is used for a
range join. The property column can contain the following values:
属性名称 |
描述 |
|---|---|
|
The value is |
|
Specifies the name of the column that represents the start of the range. |
|
Specifies the name of the column that represents the end of the range. |
关系的属性¶
如果 object_kind 列包含 RELATIONSHIP,则 property 列可能包含以下值:
属性名称 |
描述 |
|---|---|
|
关系中其中一个逻辑表的名称。 |
|
关系中使用的该逻辑表中列的名称。 |
|
关系中另一个逻辑表的名称。 |
|
One of the following values:
|
事实、维度和指标的属性¶
如果 object_kind 列包含 FACT、DIMENSION 或 METRIC,则 property 列可能包含以下值:
属性名称 |
描述 |
|---|---|
|
用于定义维度、事实或指标的逻辑表的名称。 |
|
维度、事实或指标的 SQL 表达式。 |
|
求值 SQL 表达式的 SQL 数据类型。 |
|
|
备注
For derived metrics, the TABLE property is not present.
In addition, if the row represents a
dimension that uses a Cortex Search Service, the property
column can contain the following values:
属性名称 |
描述 |
|---|---|
|
The name of the column that the Cortex Search Service allows you to search on. |
|
The name of the database that contains the Cortex Search Service. |
|
The name of the schema that contains the Cortex Search Service. |
|
The name of the Cortex Search Service. |
Properties for custom instructions¶
If the object_kind column contains CUSTOM_INSTRUCTIONS, the property column can contain the following values:
属性名称 |
描述 |
|---|---|
|
Custom instructions for Cortex Analyst that explain how to classify questions. |
|
Custom instructions for Cortex Analyst that explain how to generate the SQL statement. |
语义视图的属性¶
如果 object_kind 列是 NULL,则 property 列可能包含以下值:
属性名称 |
描述 |
|---|---|
|
关于语义视图的注释。 |
访问控制要求¶
A role used to execute this operation must have the following privileges at a minimum:
权限 |
对象 |
备注 |
|---|---|---|
任意 |
语义视图 |
Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema.
有关创建具有指定权限集的自定义角色的说明,请参阅 创建自定义角色。
使用说明¶
要对该命令的输出进行后处理,可以使用 管道运算符 或 RESULT_SCAN 函数。这两种构造都将输出视为可以查询的结果集。
For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.
When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column
type, specifySELECT "type".You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.
示例¶
以下示例描述了名为 tpch_rev_analysis 的语义视图: