Back to changelog
New
•2 minute read

Snowflake: Interactive Warehouses

Atlas now manages Snowflake interactive warehouses with the new interactive_warehouse block, including the interactive tables attached to each one.

The new interactive_warehouse block declares a Snowflake interactive warehouse, which serves low-latency queries over the interactive tables attached to it. Atlas inspects, diffs, and plans it with CREATE INTERACTIVE WAREHOUSE and ALTER WAREHOUSE, next to the standard warehouses it already manages.

Example

Interactive warehouses are account-level objects. They use the same warehouses = true switch as standard warehouses, need a database-scoped URL, and are scoped with an include pattern of type interactive_warehouse:

atlas.hcl
env "local" {  url = "snowflake://user:password@account_identifier/DEMO_DB?warehouse=DEMO_WH"  dev = "snowflake://user:password@account_identifier/DEMO_DEV_DB?warehouse=DEMO_WH"  schema {    src = "file://schema/main.hcl"    mode "snowflake" {      warehouses = true    }  }  include = [    "PUBLIC",    "SALES_IWH[type=interactive_warehouse]",  ]}

The warehouse attaches the two interactive tables from the interactive tables example:

schema/main.hcl
interactive_warehouse "SALES_IWH" {  size                         = XSMALL  auto_suspend                 = 86400  initially_suspended          = true  fallback_warehouse           = "DEMO_WH"  max_concurrency_level        = 8  statement_timeout_in_seconds = 5  comment                      = "Low-latency lookups on sales data"  tables = [    interactive_table.CUSTOMER_ORDER_LOOKUP,    interactive_table.DAILY_REVENUE_BY_REGION,  ]}

Changing size to SMALL and removing CUSTOMER_ORDER_LOOKUP from tables plans the changes in place:

atlas schema apply
-- Modify warehouse "SALES_IWH"ALTER WAREHOUSE "SALES_IWH" SET WAREHOUSE_SIZE = 'Small';-- Detach tables from warehouse "SALES_IWH"ALTER WAREHOUSE "SALES_IWH" DROP TABLES (PUBLIC.CUSTOMER_ORDER_LOOKUP);

Attributes

  • tables lists the attached tables, as interactive_table references or as qualified names for tables Atlas does not manage. Changes are planned as ADD TABLES and DROP TABLES.
  • fallback_warehouse names the warehouse that runs the queries the interactive warehouse times out on, as a warehouse reference or a name.
  • initially_suspended = true creates the warehouse suspended, so it is not billed until it is resumed. Snowflake does not report it back, so it applies to creation only.
  • size, auto_suspend, auto_resume, resource_monitor, min_cluster_count, max_cluster_count, max_concurrency_level, statement_timeout_in_seconds, statement_queued_timeout_in_seconds, comment, and tag blocks work as on a standard warehouse.

Notes

  • Snowflake requires an auto_suspend of at least 86400 seconds and caps statement_timeout_in_seconds at 5. Atlas rejects other values before planning. Leave auto_suspend out to never suspend the warehouse.
  • A warehouse cannot change between standard and interactive after creation. Declare a new warehouse under another name instead.
  • Creating an interactive warehouse switches the session to it. The planned statement restores the session warehouse afterwards, so set warehouse= on the URL.

Getting Started

Snowflake support is part of Atlas Pro. Run atlas login to get started.

featuresnowflakewarehouseinteractive tableatlas pro