Snowflake is a cloud-based data storage solution widely used by analysts, generally termed a "data warehouse-as-a-service”.
You'll need to provide certain details and credentials so Pecan can access the relevant data in Snowflake. If you need help with the below steps, be sure to consult with your internal IT or DevOps team.
First, make sure you whitelist these Pecan IP addresses:
220.127.116.11 18.104.22.168 22.214.171.124 126.96.36.199 188.8.131.52 184.108.40.206 220.127.116.11
Next, create a role with Read and Write permissions so Pecan can access your data service. Here’s how:
Log in to Snowflake as “securityadmin”. If you don’t have the necessary credentials, talk to your Snowflake admin.
Run the below command to create a Pecan user and role.
CREATE role pecan_role; GRANT USAGE on warehouse COMPUTE_WH to role pecan_role; CREATE USER pecan_user password='pecan_user' DEFAULT_ROLE = pecan_role must_change_password = false DEFAULT_WAREHOUSE = COMPUTE_WH; GRANT ROLE pecan_role TO USER pecan_user; GRANT select,insert on all tables in schema demo_db.public to role pecan_role; GRANT usage on schema demo_db.public to role pecan_role;
Make sure to adjust the following objects in the script according to your own configuration and preferences:
- Warehouse name (“COMPUTE_WH” in the example)
- Database name and schema (“demo_db.public” in the example)
- Dedicated username and password (instead of “pecan_user”)
How to configure a Snowflake connection
Log in to Pecan, select the “Connections” tab, and click Add connection.
Select “Snowflake” and complete the following fields:
Connection name – This is how you’ll identify the connection when creating and working with models on the platform. Note connection name can’t be changed once created.
Connection type – Select "Read" if the connection will be used to import data into Pecan. Select "Write" if it will be used to export predictions from Pecan to Snowflake.
Snowflake URL – you can find this by opening your Snowflake environment and copying the URL. It will be in the format of http://account.region.snowflakecomputing.com, where “account“ is your Snowflake account name, and “region” is the region where it’s hosted (and may or may not be present).
Username – according to the one you specified in step 2b above.
Password – according to the one you specified in step 2b above.
Database name – this is the name of the database Pecan should use. Servers can hold many different databases; if you want to use multiple databases to create models in Pecan but they sit on the same server, you’ll need to create a new connection for each database.
(Optional) Database schema – the name of the specific schema you would like to use.
NOTE: Pecan will always show the “public” schema in addition to the specified schema.
(Optional) Warehouse – the virtual warehouse you would like to access.
Now, click Test connection to make sure everything is working correctly. Then click Create connection to complete the setup. (For more information, see Testing and creating a data connection.)