Getting Started with Snowflake

Prev Next

To start testing Snowflake with Validatar, connect your account with key-pair authentication, ingest its metadata, look at a table, add a quick test and compare a Snowflake table with the system that loads it. Plan on about 30 minutes, much of it spent in Snowflake setting up the user Validatar connects as.

When you finish, you'll have:

  • A Snowflake data source whose schemas, tables and columns are in the Validatar Catalog, refreshed every day
  • A profile of one table
  • 97 ready-made quick tests for Snowflake, and one of them running on a table with a passing result
  • A row count test that compares a Snowflake table with the source system it's loaded from

The example is the Enterprise Data Warehouse, a Snowflake warehouse on the SAMPLE_DW database, and its table LOAD_SQLSERVER_WORLDWIDEIMPORTERS.SALES_ORDERS, the warehouse copy of Sales.Orders from the Wholesale Distribution System on SQL Server.

Before you start

  • In Snowflake: a user for Validatar, and a role that can use your warehouse and read the databases and schemas you'll test. Someone who can alter that user, to attach Validatar's public key. The grants are in Connect to Snowflake.
  • In Validatar: the Data Source Admin role to create the data source, the Security Admin role to create the quick start project in step 4, and Create and Edit Tests on the data source to add tests.

Step 1: Connect Snowflake

Validatar signs in to Snowflake with key-pair authentication: it holds the private key, and you attach the matching public key to the Snowflake user.

  1. Go to Settings > Data Sources and click New Data Source.
  2. Enter a Name, such as Enterprise Data Warehouse, and choose Snowflake as the Data Source Template and the Connection Type.
  3. With Key-Pair Authentication selected, fill in Account Name, Database Name, Warehouse Name, Role Name and Username.
  4. Click View Public Key/Script and run the script it shows in a Snowflake worksheet. It attaches Validatar's public key to the user.
  5. Click Test Connection. When it succeeds, click Save.

Every field, the grants the role needs and key rotation are in Connect to Snowflake. If you have an older Snowflake data source that still signs in with a password, see Migrating Snowflake Authentication.

The Snowflake connection dialog with Key-Pair Authentication selected and the account, database, warehouse, role and user filled in, with View Public Key/Script and Test Connection highlighted

Step 2: Bring in the metadata

  1. On the data source, click Schema Metadata in the left panel.
  2. Click Refresh Now. When the run finishes, Ingestion History shows it with a status and the number of schemas, tables and columns that changed.
  3. Click Set Refresh Schedule and set a daily refresh, so tables added in Snowflake reach the Catalog without anyone clicking.

On the demo, the warehouse has six schemas, including RAW, STAGING, STAR_SCHEMA and LOAD_SQLSERVER_WORLDWIDEIMPORTERS. More on ingestion in Ingesting Schema Metadata.

Schema Metadata for the Enterprise Data Warehouse, with Refresh Now, Set Refresh Schedule and the Schemas / Tables / Columns column highlighted

Step 3: Look at a table

  1. Click Catalog in the top bar and open Enterprise Data Warehouse.
  2. On the Tables tab, select SALES_ORDERS and click Run Profiles. Choose the profiles to run and click Run.
  3. Open SALES_ORDERS. When the profiles finish, the Table Info tab shows Number of Rows under Table Statistics, the Profile History tab shows the table's profile results, and each column's Column Profile tab shows its own.

The Run Profiles dialog for SALES_ORDERS with the Standard Profile set chosen and the Run button highlighted

A profile is the quickest way to see what you're about to test: how many rows, how many nulls, which values. The ingested metadata tells you something too. On the demo, open the OrderDate column and its Column Info tab shows a Data Type of TEXT: the warehouse copy stores the order dates as text, which nobody had written a test for. To profile on a schedule, see Create and Run a Profile Set.

Do it with Validatar AI (Validatar Cloud, beta). On the table's Table Info tab, click Auto-Document, which opens the AI panel with the request filled in, or open the AI panel and ask: "Draft a description of the SALES_ORDERS table and its columns in the Enterprise Data Warehouse." Review the values it writes before you keep them. You can undo the change from the chat history.

Step 4: Add a quick test

Validatar ships a set of quick tests made for Snowflake. Add them once per data source, then pick from them on any table or column.

  1. Go to Settings > Data Sources, open the data source and click Projects in the left panel.
  2. Click New Quick Start Project, then the Validatar Data Quality Monitoring tile.
  3. Keep the suggested Project Name (Enterprise Data Warehouse - Validatar DQM in the example), check Copy Current Data Source Permissions to New Project?, and click Create Project.
  4. In the Catalog, open SALES_ORDERS, go to the Tests tab and click Add Test.
  5. Pick table row count - in range, click Next, enter 400000 for min_row_count and 500000 for max_row_count, then click Next and Create Test.
  6. Click Run in the Preview column. It shows Passed: the table holds 431,507 orders, inside the range.

The new project holds 97 quick tests (24 for tables, 73 for columns) and four daily jobs you can add them to. On a column the list changes: open OrderID from the table's Columns tab and add column values - are unique, because a duplicated order id double-counts that order's revenue in every report. Each step of the wizard, and scheduling from it, is in Run Your First Test in 10 Minutes.

Step 5: Compare Snowflake with its source

A table can hold a plausible number of rows and still be wrong. SALES_ORDERS passes its range test, but its source has thousands more orders. To see that, connect the source system as a second data source and compare the two counts in one standard test. The warehouse side of the comparison is this query:

-- Orders in the warehouse copy of the wholesale orders table. Pass: the same count as the system.
SELECT COUNT(*) AS ORDER_COUNT
FROM LOAD_SQLSERVER_WORLDWIDEIMPORTERS.SALES_ORDERS

The whole test, from both queries to a nightly schedule, is in Check That Row Counts Match Between Source and Target. On the demo it fails: the warehouse holds 431,507 orders and the wholesale system more than 479,000, because the warehouse copy stops in late April 2024.

Step 6 (optional): Run comparisons inside Snowflake

By default, Validatar's Built-In engine fetches both data sets and compares them on the Validatar server. That's fine for counts and summaries. For record-level comparisons of large tables, a Snowflake data processing engine runs the comparison inside your Snowflake account and sends back only the summary result, and the results are stored in Snowflake. It's a licensed feature: if Snowflake isn't offered as an Engine Type, contact your account representative.

  1. Go to Settings > Data Processing Engines and click New Engine.
  2. Enter a Name, choose Snowflake as the Engine Type, fill in the connection and click Save.
  3. Click Generate Setup Script and run the script in Snowflake. It creates the user, role, warehouse and database the engine uses.
  4. Click Generate Public/Private Keys, then View Public Key/Script, and run that script in Snowflake.
  5. Click Validate Settings. Every check should pass.
  6. Open your data source's Connection page, set Processing Engine to the new engine and click Save.

A standard test runs on the engine of the data source chosen under What do you want to test?, so put the Snowflake data source on that side when you want the comparison to happen in Snowflake. Full details, including what each setup step creates: Creating a Snowflake Data Processing Engine and What Is a Data Processing Engine?

Check that it worked

  • Catalog: the Enterprise Data Warehouse lists its schemas and tables, and Schema Metadata shows a refresh schedule.
  • Tests: the Tests tab on SALES_ORDERS lists the row count test with its result.
  • Projects: Enterprise Data Warehouse - Validatar DQM appears under Projects, with its four jobs.

Troubleshooting

Symptom Cause Fix
Test Connection fails to sign in The public key isn't attached to the Snowflake user, or it belongs to a different user Run the script from View Public Key/Script again as a Snowflake user who can alter the Validatar user, and check the Username matches
"Selected data agent doesn't support key-pair auth" The data source's Data Agent Group runs a Data Agent older than 2025.2 Upgrade the Data Agent to 2025.2 or later, or choose another Data Agent Group
Ingestion finishes with no tables, or some schemas are missing The role can't see them Grant the role usage on the database and schemas and select on their tables, then click Refresh Now
No Validatar Data Quality Monitoring tile The data source doesn't use the Snowflake data source template Check the Data Source Template on the Connection page
New Quick Start Project is disabled You don't have the Security Admin role Ask a Security Admin to create the project
The quick test shows an error instead of a result The query couldn't run, usually a missing grant See Why Is My Test Failing or Erroring?

Next steps

Engineers who work in an AI coding tool can do all of this through the Validatar MCP server or the Validatar Agent Kits.