Context

 What is a Context in Snowflake :

As Snowflake is cloud native OLAP database and it is shared disk and shared - nothing architecture, 

 we need to provide how it has to process the queries as Snowflake charges separately for storage and computing separately.

so the below 4 components together called as Context

  • Role
  • Warehouse 
  • Database
  • Schema 
In case of  WebUI we can see this as below

SHOW ROLES;
SHOW WAREHOUSES;
SELECT * FROM INFORMATION_SCHEMA.DATABASES;

When you want to define this using SQL we can do this as below.

USE ROLE {role};
USE WAREHOUSE {warehouse};
USE DATABASE {database};
USE SCHEMA {schemaname};

Comments