Semantic view sharing

Semantic views (also known as semantic models) provide a mechanism to give additional context to Snowflake schemas to help generate highly accurate SQL from natural language. This is useful for Cortex Analyst to be able to generate and execute SQL from natural language prompts or from Cortex Agents.

Providers can share semantic views in a listing on the Snowflake Marketplace via a private listing or an organizational listing.

Create a semantic view

You can use the Snowflake UI or SQL commands to create a semantic view. The Snowflake UI is the recommended method for creating semantic views.

Follow the steps in Getting started to create a semantic view.

Share a semantic view in a listing

Providers can follow the steps below to attach a semantic view to a private listing or an organizational listing.

  1. In Provider Studio, select + Add data product.

  2. Select the database that has the semantic view you want to share.

  3. In the database, select the semantic views you want to attach to the listing. Note that the referenced tables will also be selected.

  4. Select Done and then Save to create the share.

  5. Fill in the remaining details for the listing, and then Publish the listing.

Share a semantic view using SQL

To create and share a semantic view using SQL, follow these steps:

  1. Use the CREATE LISTING command to create a new secure object in the current account.

  2. Use the GRANT <privilege> … TO SHARE command to share the object.

  3. Share the secure share with other accounts.

Ensure that the tables referenced in the view are also shared. You can do this by running the following commands:

GRANT REFERENCES ON SEMANTIC VIEW <view_name> TO SHARE <share_name>;
GRANT SELECT ON SEMANTIC VIEW <view_name> TO SHARE <share_name>;
Copy

In addition, the provider must also grant tables referenced in a semantic view to the share.

Limitations

  • Replication and auto-fulfillment for semantic views are not supported.

  • Semantic view sharing is not supported across regions.

Language: English