Snowflake Database
Follow our setup guide to connect your Snowflake data warehouse to Gravity.
Prerequisites
To connect Snowflake to Gravity, you need the following:
A Snowflake account with the appropriate permissions to create a user and warehouse for Gravity.
Gravity account owner permission to add destinations.
IMPORTANT: In Snowflake, if you use double quotes around an identifier name, it makes the identifier name case-sensitive. We recommend using the
create <identifier> <identifier_name>
or thecreate <identifier> "IDENTIFIER_NAME"
format. See Snowflake's documentation on identifiers for more information.
Setup instructions
Choose Snowflake warehouse type
You can choose to create an exclusive warehouse for Gravity or use an existing warehouse:
You can create and use an exclusive warehouse for Gravity. The benefit of this route is that Gravity operations will never contend with your queries for resources and this is useful when it comes to diagnosing performance issues if you face concurrency/waiting problems in your data warehouse.
You can use a shared warehouse to reduce your warehouse running cost. Gravity does not consume much resources through loading data incrementally but it will possibly drive longer wait times if you share a warehouse with multiple applications. This is not a Gravity issue but a warehouse/cost design decision you need to make.
Run script in Snowflake warehouse
Log in to your Snowflake data warehouse.
Copy the following script to a new worksheet and select the All Queries checkbox.
DO NOT execute this script yet. See Step 4 for notes on which items you need to replace, including the password.
If you want to create a new warehouse do not make any changes. If you want to use a shared warehouse to ingest data, change the GRAVITY
_WAREHOUSE
value in the script to the name of the shared warehouse.Replace the default GRAVITY
_ROLE
, GRAVITY_DATABASE
, GRAVITY_USER
, and SETPASSWORD values with values that conform to your specific naming conventions for those resources.Run the script.
Configure Snowflake network policy
If you don't have a network policy you need to create one or you can update your policy. The addresses below are Gravity IP Addresses.
To create: Use the CREATE NETWORK POLICY and an example is here:
CREATE NETWORK POLICY <gravity_ip_whitelist> ALLOWED_IP_LIST = ('
35.242.183.251/32', '
35.246.26.172/32', '
35.197.252.236/32','
35.234.142.96/32', '
35.234.128.102/32', '
34.105.214.159/32');
To update: Use the ALTER NETWORK POLICY and an example is here
ALTER NETWORK POLICY <your_network_policy_name> SET {[ALLOWED_IP_LIST] = ('
35.242.183.251/32', '
35.246.26.172/32', '
35.197.252.236/32','
35.234.142.96/32', '
35.234.128.102/32', '
34.105.214.159/32')]};
Create Destination in Gravity
Log in to your Gravity and click on Destinations, Choose Snowflake
Insert your Host Name. Port Number and Database Name.
Insert your User name and Password
Click Save & Test.
Test checks connectivity to Snowflake and permission to create schemas and tables on your Snowflake database.
Gravity has now validated the destination and if successful you can add sources or create jobs. If unsuccessful, please go back through the steps above or contact Gravity Support.
Last updated