This repository contains the Tasty Bytes sample, packaged as a Semantic Modeling Language (SML) model that is the structural equivalent of the Snowflake TASTY_BYTES_SVA Semantic View. The same conceptual model — the food-truck business of the fictional "Tasty Bytes" company — is presented two ways:
- As a Snowflake Semantic View defined in SQL.
- As an SML model (datasets, dimensions, metrics, relationships, and a top-level model file) that can be deployed to a semantic layer such as AtScale.
The goal is to provide a side-by-side reference for teams migrating Snowflake Semantic Views into SML, or evaluating how the two representations relate to one another.
The Tasty Bytes story and dataset come from the official Snowflake tutorial:
Tutorial: Tasty Bytes — Sample data and the Snowflake SQL Worksheet
Tasty Bytes models a global food-truck company. The data covers customers, franchises, menus, individual food trucks, locations they operate at, and the order line items they sell. It is widely used by Snowflake as a teaching dataset for SQL, semantic views, and Cortex Analyst.
The version of the dataset in this repo is a Summit 2026 variant of that tutorial sample; it includes additional supporting tables (campaigns, menu tags, ingredients) and the Power BI–compatible views needed to back a Snowflake Semantic View.
assets/ Snowflake setup script (DDL + INSERTs + Semantic View)
connections/ SML connection definition pointing at SUMMIT_2026.TASTY_BYTES
datasets/ SML datasets — one per source table/view
dimensions/ SML dimensions (with hierarchies and levels)
metrics/ SML measures (sums, distinct counts)
calculations/ SML calculated measures (e.g. AVG_ORDER_VALUE)
models/ SML model file that wires everything together
catalog.yml SML catalog definition
README.md This file
setup_tasty_bytes.sql is a self-contained Snowflake script. Running it in any Snowflake account will:
-
Create the database and schemas
- Database
SUMMIT_2026 - Schemas
SUMMIT_2026.TASTY_BYTES(base tables) andSUMMIT_2026.TASTY_BYTES_DEV(mirror views)
- Database
-
Create and populate the base tables in
SUMMIT_2026.TASTY_BYTES:Table Description CAMPAIGNMarketing campaigns with type, channel, target item, budget and date window CAMPAIGN_PERFORMANCEDaily impressions, clicks, conversions, spend and attributed revenue per campaign CUSTOMERCustomer demographic and contact details DATE_DIMCalendar date dimension DIM_TIMESub-daily time-of-day dimension (hour / minute / second / AM-PM) FRANCHISEFranchise owners and locations INGREDIENTIngredient master list LOCATIONPhysical locations where trucks operate (city / region / country) MENU_CATEGORYMenu category lookup MENU_ITEMMenu items with category, pricing, COGS and dietary flags MENU_ITEM_INGREDIENTSItem ↔ ingredient mapping MENU_ITEM_TAGSItem ↔ tag mapping MENU_TYPEMenu type / cuisine style ORDER_DETAILOrder line items — the central fact table TAGTag master list TRUCKIndividual food trucks, with make, model, year, franchise affiliation and EV flag -
Create mirror views in
SUMMIT_2026.TASTY_BYTES_DEV— one-to-one passthroughs of every base table, intended for downstream development environments. -
Create the Power BI–compatible views (
DT_DIM_*andDT_FACT_ORDER_DETAIL) inSUMMIT_2026.TASTY_BYTES. These reshape the base tables — splitting names, deriving ISO codes, computing truck age, exposing the order fact with aTIME_IDcolumn — into the shape expected by the Semantic View. -
Create the Semantic View
TASTY_BYTES_SVA.
The semantic view is the focal point of the Snowflake side of this sample. It declares, in a single SQL DDL statement:
- Tables (logical):
CUSTOMER,DATE,FRANCHISE,LOCATION,MENU_ITEM,TIME,TRUCK, andORDER_DETAILS— each bound to one of theDT_DIM_*/DT_FACT_*views above, with primary keys and descriptive comments. - Relationships: Seven
many_to_onejoins fromORDER_DETAILSto each of the dimension tables (CUSTOMER,DATE,FRANCHISE,LOCATION,MENU_ITEM,TIME,TRUCK). - Facts: Row-level numeric columns such as
ORDER_DETAILS.LINE_TOTAL,ORDER_DETAILS.QUANTITY,ORDER_DETAILS.UNIT_PRICE,TRUCK.TRUCK_AGE, calendar parts onDATE, and clock parts onTIME. - Dimensions: All descriptive attributes — customer name / city / country, menu item name / category / dietary flags, truck brand / make / model / region, location city / region / country, calendar attributes, time-of-day attributes, etc.
- Metrics: Three aggregated measures on
ORDER_DETAILS:ORDER_AMT—SUM(LINE_TOTAL)— total revenueORDER_COUNT—COUNT(DISTINCT ORDER_ID)— number of ordersORDER_QTY—SUM(QUANTITY)— total items sold
Each column carries a human-readable comment and representative sample_values, which is what makes the view consumable by Snowflake Cortex Analyst.
The SML model in this repo is a faithful conversion of TASTY_BYTES_SVA into the SML object model:
| Snowflake Semantic View concept | SML object |
|---|---|
Logical table (tables (...)) bound to a view |
A file under datasets/ (e.g. ORDER_DETAILS.yml) with connection_id: con_SUMMIT_2026_TASTY_BYTES and table: DT_FACT_ORDER_DETAIL |
| Primary key on a logical table | The key columns on the corresponding dimension under dimensions/ |
Relationship (relationships (...)) |
A relationships: entry in Tasty Bytes.yml joining the fact dataset to a dimension's lowest level |
| Dimension column on a logical table | A level attribute inside the matching *_dimension.yml file |
| Fact column on a logical table | A numeric attribute or a degenerate dimension on the dataset |
Metric (metrics (...)) — sum / count distinct |
A file under metrics/ (e.g. ORDER_DETAILS.ORDER_AMT.yml) |
Comments and sample_values |
description: fields on datasets, dimensions, and metrics |
| Semantic View itself | The top-level models/Tasty Bytes.yml file, which assembles the dimensions, metrics, and relationships |
One dataset per Snowflake logical table, pointing at the same DT_DIM_* / DT_FACT_* view that backs the semantic view. The dataset describes the physical columns only — semantics live in the dimension and metric files.
Each *_dimension.yml defines a dimension with a hierarchy and at least one level keyed on the same column used as the semantic view's primary key. Attributes that appear under dimensions (...) in the semantic view become level attributes; date/time attributes are organised on the DATE_dimension and TIME_dimension hierarchies.
- The three semantic-view metrics (
ORDER_AMT,ORDER_COUNT,ORDER_QTY) are converted to plain SML measures undermetrics/. - The SML model extends the Snowflake original with a calculated measure,
ORDER_DETAILS.AVG_ORDER_VALUE(calculations/), implemented in terms of two helper sub-measures (AVG_ORDER_VALUE_SUB_0,AVG_ORDER_VALUE_SUB_1). This is one of the practical benefits of moving from a Snowflake Semantic View to SML — the SML calculation engine supports arithmetic across measures, which the Snowflake Semantic View does not express directly.
The seven ORDER_DETAILS → dimension joins from the semantic view are reproduced verbatim as SML relationships. Additional self-relationships are declared on each dimension table so that the dimensions can also be queried independently of the order fact.
Everything points at the same physical schema as the Snowflake setup script via con_SUMMIT_2026_TASTY_BYTES.yml (database: SUMMIT_2026, schema: TASTY_BYTES).
- Load the data into Snowflake. Run
assets/setup_tasty_bytes.sqlin any Snowflake account. This creates the database, schemas, tables, mirror views, Power BI–compatible views, and theTASTY_BYTES_SVASemantic View. - (Optional) Query the Snowflake Semantic View directly with
SELECT ... FROM SEMANTIC_VIEW(SUMMIT_2026.TASTY_BYTES.TASTY_BYTES_SVA ...)to see the original semantic surface. - Deploy the SML model by pointing your semantic-layer tool at this repository and configuring the
con_SUMMIT_2026_TASTY_BYTESconnection to your Snowflake account. The model expects the views created in step 1 to exist inSUMMIT_2026.TASTY_BYTES.
- Snowflake — Tasty Bytes SQL load tutorial
- Snowflake — Semantic Views overview
- Semantic Modeling Language (SML) specification