DESCRIBE SEMANTIC VIEW
statementsupportedAI & MLDescribes the properties of the logical tables, dimensions, facts, and metrics that make up a semantic view. See also: 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
Syntax
{ DESCRIBE | DESC } SEMANTIC VIEW <name>
Parameters
| Name | Required | Description |
|---|---|---|
name | Specifies the identifier for the semantic view to describe. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. For more information, see Identifier requirements. |
Usage notes
- To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query. 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, specify SELECT "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.
Output
The command output provides the properties and metadata about the logical tables, relationships, facts, dimensions, metrics, and the semantic view itself. Each row in the view represents a property of: - A logical table - A relationship - A fact - A dimension - A metric - A verified query - Custom instructions - The semantic view itself The following is an example of the output of the command: As shown above, each row represents a property of a logical table, dimension, relationship, metric, or fact. For example: - The first row is the value of the comment property of the semantic view itself. - The second row is the value of the base_table_database_name property of the logical table named customers. The view includes the following columns: Column | Description object_kind | Type of the object that has the property for this row. The value can be one of the following: TABLE (the logical tables for the view) RELATIONSHIP DIMENSION FACT METRIC DERIVED_METRIC (for derived metrics) CUSTOM_INSTRUCTIONS (for custom instructions) AI_VERIFIED_QUERY (for verified queries) NULL (properties that apply to the semantic view itself, such as a comment) object_name | Name of the dimension, fact, metric, logical table, relationship, or verified query that has the property for this row. For rows that represent properties of the semantic view itself and rows that represent custom instructions, the value in this column is NULL. parent_entity | Name of the parent entity of the dimension, fact, metric, or relationship. The value of this column is NULL for rows that represent: The semantic view itself. Properties of logical tables. Properties of derived metrics. Properties of custom instructions. Properties of verified queries. property | Name of the property of the logical table, constraint, relationship, dimension, fact, metric, custom instruction, or semantic view. The value in this column depends on the type of the object (object_kind). See the following sections for details about the properties and their possible values, based on the value in the object_kind column: For TABLE, see Properties for logical tables. For CONSTRAINT, see Properties for constraints. For RELATIONSHIP, see Properties for relationships. For FACT, DIMENSION, and METRIC, see Properties for facts, dimensions, and metrics. For CUSTOM_INSTRUCTIONS, see Properties for custom instructions. For AI_VERIFIED_QUERY, see Properties for verified queries. For NULL, see Properties for semantic views. property_value | Value of the property of the logical table, relationship, dimension, fact, metric, custom instruction, or semantic view. If the object_kind column contains TABLE, the property column can contain the following values: Property name | Description BASE_TABLE_DATABASE_NAME | Name of the database containing the logical table. Not present if the logical table is defined as a SQL query. BASE_TABLE_SCHEMA_NAME | Name of the schema containing the logical table. Not present if the logical table is defined as a SQL query. BASE_TABLE_NAME | Name of the logical table. Not present if the logical table is defined as a SQL query. DEFINITION | The SQL query that defines the logical table. Present only if the logical table is defined as a SQL query rather than a physical table. SYNONYMS | Array of VARCHAR values, representing the synonyms for the logical table. PRIMARY_KEY | Array of VARCHAR values, specifying the names of the columns that make up the primary key for the logical table. 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: Property name | Description CONSTRAINT_TYPE | The value is DISTINCT_RANGE. START_COLUMN | The name of the column that represents the start of the range. END_COLUMN | The name of the column that represents the end of the range. If the object_kind column contains RELATIONSHIP, the property column can contain the following values: Property name | Description TABLE | Name of one of the logical tables in the relationship. FOREIGN_KEY | Name of the column in that logical table used in the relationship. REF_TABLE | Name of the other logical table in the relationship. REF_KEY | One of the following values: For relationships that represent range joins, an array that contains JSON-formatted strings for objects with the following keys: The start_column key specifies the name of the column that represents the start of the range. The end_column key specifies the name of the column that represents the end of the range. The type key is RANGE. For relationships that represent ASOF joins, an array that contains the following elements: The name of the column in the first table. A JSON object with the following fields: column: Name of the column in the second table. type: ASOF. For other types of relationships, the name of the column in the other logical table in the relationship. If the object_kind column contains FACT, DIMENSION, or METRIC, the property column can contain the following values: Property name | Description TABLE | Name of the logical table used to define the dimension, fact, or metric. EXPRESSION | The SQL expression for the dimension, fact, or metric. DATA_TYPE | The SQL data type of the evaluated SQL expression. ACCESS_MODIFIER | PRIVATE for private facts and metrics. PUBLIC for everything else. Note 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: Property name | Description CORTEX_SEARCH_SERVICE_COLUMN_NAME | The name of the column that the Cortex Search Service allows you to search on. CORTEX_SEARCH_SERVICE_DATABASE_NAME | The name of the database that contains the Cortex Search Service. CORTEX_SEARCH_SERVICE_SCHEMA_NAME | The name of the schema that contains the Cortex Search Service. CORTEX_SEARCH_SERVICE_NAME | The name of the Cortex Search Service. If the object_kind column contains CUSTOM_INSTRUCTIONS, the row represents a property of a custom instruction. The property column can contain the following values: Property name | Description AI_QUESTION_CATEGORIZATION | Custom instructions for Cortex Analyst that explain how to classify questions. AI_SQL_GENERATION | Custom instructions for Cortex Analyst that explain how to generate the SQL statement. If the object_kind column contains AI_VERIFIED_QUERY, the row represents a property of a verified query. The property column can contain the following values: Property name | Description QUESTION | The question that should produce the expected query. VERIFIED_AT | The timestamp (in seconds after the Unix epoch) when the query was verified. ONBOARDING_QUESTION | If TRUE, the question is an onboarding question (a question that is suggested to users interacting with an app powered by Cortex Analyst). VERIFIED_BY | The purpose and name of the contact who verified that the query answers the question. SQL | The SQL statement for the query that answers the question. If the object_kind column is NULL, the property column can contain the following values: Property name | Description COMMENT | Comment about the semantic view.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes Any | Semantic view | 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. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.