Skip to main content

Snowflake Profiler Details

Prerequisites

  • A Snowflake user with permission to create Personal Access Tokens (PATs) and to query the SNOWFLAKE.ACCOUNT_USAGE schema (e.g., the ACCOUNTADMIN role or a role granted IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE).
  • The rate_sheet step also reads SNOWFLAKE.ORGANIZATION_USAGE.RATE_SHEET_DAILY for the effective credit rate and account tier. This is available to ACCOUNTADMIN in an ORGADMIN-enabled account (the first account in an organization is ORGADMIN-enabled by default, so single-account orgs are covered), or to a custom role granted the ORGANIZATION_BILLING_VIEWER database role. If the account isn't ORGADMIN-enabled — or the organization is on a reseller contract — the view returns no rows, so rate_sheet is skipped and the rest of the profile still completes.
  • Network access from the machine running Lakebridge to your Snowflake account.

Authentication

The Snowflake profiler authenticates with a Programmatic Access Token (PAT). Follow Snowflake's official guide to generate one:

Snowflake docs: Programmatic access tokens

You'll need:

  • account — your Snowflake account identifier (e.g., myorg-myaccount.snowflakecomputing.com)
  • user — Snowflake username
  • role, warehouse, database, schema — typically ACCOUNTADMIN, COMPUTE_WH, SNOWFLAKE, ACCOUNT_USAGE
  • The PAT itself (paste when prompted; it's stored under pat in the credentials file)

If your account or user has a network policy, also see Snowflake's docs on bypassing the network policy on a PAT for short-term testing from a dynamic IP.

Configure and run the profiler

databricks labs lakebridge configure-database-profiler

Pick snowflake when prompted, then paste the connection details and PAT.

databricks labs lakebridge execute-database-profiler

The extract is written to a DuckDB file at ~/.databricks/labs/lakebridge_profilers/snowflake_assessment/profiler_extract.db. It contains raw SNOWFLAKE.ACCOUNT_USAGE data — warehouse usage, query history, storage, users, and (when applicable) pipe / autoclustering / materialized-view refresh credits. By default each extract looks back 90 days. Inspect it with:

cd ~/.databricks/labs/lakebridge_profilers/snowflake_assessment
duckdb profiler_extract.db "SHOW TABLES;"
duckdb profiler_extract.db "SELECT * FROM warehouse_usage LIMIT 10;"
duckdb profiler_extract.db "SELECT * FROM query_history LIMIT 10;"