Snowflake
Snowflake is a cloud data warehouse. The Snowflake connector lets TAO explore your databases and run read-only queries, and it can also show what your warehouse costs.
What you can do
Illustrative examples.
- Ask Nexus which tables exist in a schema, and what is in them.
- Preview a few rows of a table, or count its rows.
- Profile one column: how many values, how many blanks, the smallest and largest.
- Check how many credits (Snowflake's billing unit) your warehouse used last week.
- Look at a scheduled task's definition.
Before you connect
You need a Programmatic Access Token. This is a long secret that stands in for a password. You create it on your own user's Programmatic Access Tokens page in Snowflake. You do not need to be an account administrator to make your own.
You also need four details:
| Field | What to enter |
|---|---|
| Account identifier or host | Your account identifier, which looks like orgname-accountname, or the full host. TAO adds snowflakecomputing.com to a bare identifier |
| User | The Snowflake user the token was created for |
| Role | The exact role the token is restricted to, spelled as Snowflake shows it |
| Warehouse | The warehouse TAO should run SQL on |
None of these is guessed. The warehouse is never defaulted, because Snowflake bills the warehouse that is actually used.
Connect it
Create the token in Snowflake
On your Snowflake user, open the Programmatic Access Tokens page and create a token restricted to your chosen role. Copy it. Paste just the token later, not an Authorization header or a URL.
Open Connectors
In TAO, go to Settings > Connectors, find Snowflake and click Connect.
Fill in the form
Paste the token, then fill in Account identifier or host, User, Role and Warehouse. All are required.
Save
Save the connection. The token is stored encrypted and is not shown again.
An administrator must switch the Snowflake connector on first. It is created switched off.
Tools
| Tool name | What it does | Read or Write |
|---|---|---|
snowflake_list_databases | Lists databases the role can see. No warehouse needed | Read |
snowflake_list_schemas | Lists schemas in one database | Read |
snowflake_list_tables | Lists tables in one schema | Read |
snowflake_describe_table | Shows one table's own record | Read |
snowflake_search_objects | Finds tables in a schema by a name pattern (% and _ wildcards) | Read |
snowflake_run_query | Runs one read-only SELECT. Uses warehouse credits | Read |
snowflake_get_query_result | Checks or re-fetches an earlier query by its statement handle | Read |
snowflake_cancel_query | Cancels a statement this session started | Write, runs at once (no approval) |
snowflake_preview_table | Shows a few rows of a table. Uses credits | Read |
snowflake_row_count | Gives the exact row count of a table. Uses credits | Read |
snowflake_column_profile | Counts, distinct, nulls, min and max for one column. Uses credits | Read |
snowflake_list_warehouses | Lists warehouses and whether each is started or suspended | Read |
snowflake_describe_warehouse | Shows one warehouse's state and size | Read |
snowflake_query_history | Recent queries on the account, from Snowflake's usage history | Read |
snowflake_warehouse_credit_usage | What the warehouse has cost, from Snowflake's metering history | Read |
snowflake_list_tasks | Lists scheduled tasks in a schema | Read |
snowflake_describe_task | Shows one task's schedule, warehouse and SQL | Read |
Total: 17 tools. 16 read, 1 that cancels a running query. No tool changes your data, and no tool waits for approval.
Limits and good to know
- Read-only SQL. A statement must be one SELECT or WITH ... SELECT. Anything with a semicolon or a data-changing keyword is refused. A row limit (default 500, up to 5000) and an ORDER BY are enforced for you.
- Suspended warehouses are not woken. Snowflake charges a 60-second minimum each time a warehouse resumes. So tools that run SQL refuse if the warehouse is not started. Resume it yourself, then try again.
- Some tools cost credits. Metadata listing is free. Queries, previews, row counts, column profiles, query history and credit usage run on your warehouse and spend credits.
- Usage history can lag. Query history and credit usage come from Snowflake's own usage views. They can be hours behind. They also need your role to have been granted access. An access error there is a permission issue, not a fault.
- Counts differ in the product notes. The tool list holds 17 tools. A code comment in the gateway says "16 reads + 1 mutating", which matches: 16 plus the cancel tool.
- No write tools exist, so there is nothing to approve for this connector.