Skip to main content

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:

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.

  1. 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
  2. Open the script in your editor and locate the reference to ATLAN_CONTEXT_STORE:

    ATLAN_CONTEXT_STORE."entity_metadata"
  3. Replace the reference to ATLAN_CONTEXT_STORE if your catalog uses a different database name:

    Find: ATLAN_CONTEXT_STORE."entity_metadata"
    Replace with: MY_CATALOG."entity_metadata"
  4. Adjust the refresh schedule if you need a different update frequency:

info

Use 1 hour as the update frequency for the Gold layer.

Every 1 hour:
SCHEDULE = 'USING CRON 0 * * * * UTC'
  1. 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.

  1. 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;
  2. 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.

  3. 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