Set up Gold layer in Snowflake
Once you have connected Snowflake to your Lakehouse, set up the Gold layer in Snowflake. The Gold layer for the Lakehouse provides a simplified, curated layer for human users and AI tools. It contains pre-joined, aggregated views that make it easier to navigate and analyze data in the Lakehouse.
Prerequisites
Before you begin, make sure you have:
- Enabled Lakehouse for your tenant. See Enable Lakehouse.
- Connected Snowflake to your Lakehouse. See Connect Snowflake to Lakehouse.
- A Snowflake role with permission to create databases, schemas, views, tables, and tasks.
Set up gold layer
To set up the Gold layer, open the SQL script from GitHub, update it for your catalog, and run it in Snowflake.
-
Download the Lakehouse Gold layer SQL script from GitHub and copy it into a local file so you can update it for your catalog.
Download SQL script -
Open the script in your editor and locate the reference to
ATLAN_CONTEXT_STORE:ATLAN_CONTEXT_STORE."entity_metadata" -
Replace the reference to
ATLAN_CONTEXT_STOREif your catalog uses a different database name:Find: ATLAN_CONTEXT_STORE."entity_metadata"
Replace with: MY_CATALOG."entity_metadata" -
Adjust the refresh schedule if you need a different update frequency:
Use 1 hour as the update frequency for the Gold layer.
Every 1 hour:
SCHEDULE = 'USING CRON 0 * * * * UTC'
- Connect to Snowflake and run the full SQL script.
This creates the ATLAN_GOLD database and all Gold layer views and tables in the ATLAN_GOLD.PUBLIC schema.
Verify setup
Once the first refresh finishes, follow these steps to confirm the database, views, and data are ready.
-
Confirm the database and views exist:
SHOW DATABASES LIKE 'ATLAN_GOLD';
SHOW VIEWS IN SCHEMA ATLAN_GOLD.PUBLIC;
SHOW TABLES IN SCHEMA ATLAN_GOLD.PUBLIC; -
Confirm data is populating in the assets view:
SELECT COUNT(*) FROM ATLAN_GOLD.PUBLIC.ASSETS;If the count is zero, wait a few minutes and run the query again.
-
Run a sample query to validate that GOLD layer views are usable:
SELECT asset_name, asset_type
FROM ATLAN_GOLD.PUBLIC.TAGS
WHERE tag_name = 'PII';
See also
Gold layer reference: Learn about the Gold layer and how to use it