Snowflake Object Hierarchy

Snowflake Architecture

Emily Melhuish

Technical Curriculum Developer, Snowflake

Understanding the Object Hierarchy

Org-level container

Snowflake Architecture

Understanding the Object Hierarchy

Org Level Container with Accounts within

Snowflake Architecture

Understanding the Object Hierarchy

Org container with accounts and database

Snowflake Architecture

Understanding the Object Hierarchy

Org container with accounts and database and schemas

Snowflake Architecture

Understanding the Object Hierarchy

Org container with accounts and database and schemas and objects

Snowflake Architecture

Account-level vs Database-level Objects

Org container with accounts and database and schemas and objects

1 https://docs.snowflake.com/en/user-guide/security-access-control-overview
Snowflake Architecture

Context

Role → Warehouse → Database → Schema

Set Session Context

  • USE ROLE
  • USE WAREHOUSE
  • USE DATABASE
  • USE SCHEMA

 

Check Session Context

  • CURRENT_ROLE()
  • CURRENT_WAREHOUSE()
  • CURRENT_DATABASE()
  • CURRENT_SCHEMA()
Snowflake Architecture

Session Variables

  • Store and re-use values
  • Create: SET min_users = 100
  • Use: SELECT $min_users;
1 https://docs.snowflake.com/en/sql-reference/sql/set
Snowflake Architecture

Parameter hierarchy: Account Parameters

hierachy 1.png

1 https://docs.snowflake.com/en/sql-reference/parameters
Snowflake Architecture

Session Parameters

hierarchy 2.png

Snowflake Architecture

Virtual Warehouse Parameters

hierarchy 3.png

Snowflake Architecture

Table Parameters

Parameter Hierarchy visualised by account, session, virtual warehouse and object levels.

Snowflake Architecture

Let's practice!

Snowflake Architecture

Preparing Video For Download...