| name | semantic-view-patterns |
| title | Apply Semantic View Patterns |
| summary | Tutorials and apply-mode for 25 Snowflake Semantic View modeling patterns spanning joins, metrics, and dimensions. |
| description | Use when learning Snowflake Semantic View patterns, teaching SV concepts, applying patterns to existing SVs, or building new SVs with best practices. Triggers: semantic view patterns, sv patterns, walk me through, time intelligence, range join, ASOF join, semi-additive, window metrics, derived metrics, role playing dimensions, accumulating snapshot, sv diagnostics, fan trap, USING clause, NON ADDITIVE BY. |
| tools | ["snowflake_sql_execute","snowflake_object_search","Read","Write","Edit","Glob","Grep"] |
| prompt | walk me through time intelligence in semantic views |
| language | en |
| status | Published |
| author | Snowflake Solutions Team |
| type | snowflake |
Semantic View Patterns
Overview
Interactive, end-to-end tutorials for 25 Snowflake Semantic View (SV) modeling patterns. Each pattern ships with annotated DDL and YAML, seed data, and live SEMANTIC_VIEW() queries. Two modes:
- Tutorial mode — deploy a working example into your account, walk through the DDL/YAML, run live queries, then clean up. Triggers: "walk me through", "teach me", "what patterns are available".
- Apply mode — read your existing SV (or table list), map the pattern's structural roles to your columns, and generate adapted DDL/YAML. Triggers: "apply X to my SV", "my tables are…", "help me implement".
If ambiguous, ask which mode the user wants.
Available Patterns
range_join, asof_join, multi_path_metrics, shared_degenerate_dimension, semi_additive_metric, window_metrics, derived_metrics, time_intelligence, entity_facts, variables, multi_fact_table, ai_metadata, tags, introspection, fact_as_relationship_key, system_explain_semantic_query, caller_rights ⚠️ ACCOUNTADMIN, standard_sql, inline_sv ⚠️ PrPr, materialization ⚠️ PrPr, scoped_dataset ⚠️ PrPr, row_access_policies ⚠️ ACCOUNTADMIN, role_playing_dimensions, accumulating_snapshot, sv_diagnostics.
Each pattern lives at <skill_dir>/snippets/<name>/ with README.md, schema.sql, seed_data.sql, semantic_view.sql, semantic_view.yaml, queries.sql.
Authoring Format
Ask whether to use DDL (CREATE SEMANTIC VIEW) or YAML (SYSTEM$CREATE_SEMANTIC_VIEW_FROM_YAML). Skip if the user already specified.
CALL SYSTEM$CREATE_SEMANTIC_VIEW_FROM_YAML(, $$ yaml $$, );
$CREATE_SEMANTIC_VIEW_FROM_YAML(, $$ yaml $$);
$READ_YAML_FROM_SEMANTIC_VIEW();