Reference¶
SQL syntax reference for all DuckDB Semantic Views statements and functions.
DDL statements
CREATE SEMANTIC VIEW – Create a new semantic view with tables, relationships, dimensions, metrics, facts, and materializations.
ALTER SEMANTIC VIEW – Rename, set, or unset comment on a semantic view.
DROP SEMANTIC VIEW – Remove a semantic view from the catalog.
DESCRIBE SEMANTIC VIEW – Inspect the full definition of a semantic view.
SHOW SEMANTIC VIEWS – List all registered semantic views with optional filtering.
SHOW SEMANTIC DIMENSIONS – List dimensions across one or all semantic views.
SHOW SEMANTIC METRICS – List metrics across one or all semantic views.
SHOW SEMANTIC FACTS – List facts across one or all semantic views.
SHOW SEMANTIC MATERIALIZATIONS – List materializations across one or all semantic views.
SHOW SEMANTIC DIMENSIONS FOR METRIC – List dimensions safe to use with a specific metric (fan trap aware).
SHOW COLUMNS IN SEMANTIC VIEW – List all queryable columns in a semantic view with types, expressions, and comments.
GET_DDL – Retrieve the full CREATE DDL text for a stored semantic view.
READ_YAML_FROM_SEMANTIC_VIEW – Export a semantic view definition as a YAML string.
YAML Definition Format – Field-by-field specification of the YAML schema accepted by
FROM YAML.
Query functions
semantic_view() – Query a semantic view with any combination of dimensions and metrics.
explain_semantic_view() – Inspect the SQL generated for a semantic view query.
Error reference
Error Messages – Error messages, causes, and fixes.