· rangkumin.tech

Snowflake adds many-to-many relationships to semantic views in preview

Snowflake has put many-to-many relationships in semantic views into preview. Data teams can model them through a bridge table or directly between columns that are not primary keys, and Snowflake infers the path and removes duplicates so metrics are not double counted.

Why it matters

The release note is dated November 13. Teams can model the relationship through a bridge table, defining two many-to-one relationships from the junction table to each entity table. In the direct form, a relationship can reference columns that are not a primary key or unique key in the other logical table, so a bridge table and a special keyword are no longer required.

Snowflake says it infers the many-to-many path from the relationship graph and handles deduplication automatically when a query fans out across the relationship, so values are not counted twice. Relationships can be defined with CREATE SEMANTIC VIEW or in the relationships key of the YAML specification. Its example is a direct relationship between orders and promotions, because one promotion code can appear in several rows.

There are limits. Queries that traverse many-to-many relationships cannot use level of detail metrics or multi-path metrics that use the USING clause. Snowflake labels the capability a preview and links to separate topics on modelling many-to-many relationships and querying them.

Sources

Choose English or Indonesian. Up to two editions a day. Unsubscribe anytime.