Manage Semantic View
DROP SEMANTIC VIEW
Deletes the specified semantic view.
Syntax:
IF EXISTS prevents errors when the view does not exist. It is recommended to always include it in scripts.
Example:
ALTER SEMANTIC VIEW
Currently only supports renaming. Does not support dynamically adding/removing dimensions, metrics, or modifying comments via SQL -- to modify the view structure, you must DROP and rebuild.
Syntax:
The new name must not include a schema prefix; after renaming, the view remains in the original schema.
Example:
SHOW SEMANTIC VIEWS
Lists all semantic views under the specified schema, returning two columns: schema_name and table_name.
Syntax:
It is recommended to always include IN <schema_name>. Without it, views under the current default schema are returned.
Example:
You can also query via information_schema.tables to get additional metadata:
DESC EXTENDED
View the complete definition of a semantic view, including logical table structures, primary/foreign key relationships, dimension metadata, and metric definitions.
Note: DESC <view_name> (without EXTENDED) returns an empty result set. You must include EXTENDED.
Syntax:
Example:
Returned content includes:
- Basic view information: workspace, schema, creator, created_time, last_modified_time, comment
- Logical table list: alias, full physical table name, primary key, foreign key
- Dimension list: name, expression,
isUnique,isTime,enumValues, comment - Metric list: name, aggregation expression, comment
Access Control
Semantic views support standard GRANT/REVOKE permission management, but only read-only permissions (SELECT, ALL) are supported. INSERT, UPDATE, and DELETE are not supported.
GRANT
REVOKE
SHOW GRANTS
View the permission grants on a semantic view:
Returned columns: granted_type, privilege, granted_on (value is SEMANTIC_VIEW), object_name, granted_to, grantee_name, grantor_name, grant_option, granted_time.
Command Quick Reference
| Command | Description |
|---|---|
DROP SEMANTIC VIEW IF EXISTS | Delete a semantic view |
ALTER SEMANTIC VIEW ... RENAME TO | Rename (the only supported ALTER operation) |
SHOW SEMANTIC VIEWS [ IN schema ] | List semantic views |
DESC EXTENDED | View full structure (must include EXTENDED) |
GRANT SELECT ON SEMANTIC VIEW | Grant query permission |
REVOKE SELECT ON SEMANTIC VIEW | Revoke query permission |
SHOW GRANTS ON SEMANTIC VIEW | View permissions |
