Snowflake
Connect to your Snowflake Data Warehouse.
Getting Started
Prerequisites to create a Snowflake based workflow. You will need
A source Snowflake connection.
(optional) A list of tables OR SQL queries.
(optional) A destination Snowflake connection.
Do not use your input data warehouse connection as an output connector. This action can result in the unintended overwriting of existing data.
Configuring a Snowflake Connection
There are two ways to authenticate a Gretel Snowflake connection, each methoed requires different fields for a connection creation:
Standard Authentication
A snowflake
connection authenticated via username/password is created using the following parameters:
name
Display name of your choosing used to identify your connection within Gretel.
my-snowflake-connection
host
Fully qualified domain name (FQDN) used to establish connection to database server.
account_identifier.snowflakecomputing.com
username
Unique identifier associated with specific account authorized to access database.
john
password
Security credential to authenticate username.
...
database
Name of database to connect to.
MY_DATABASE
warehouse
Name of warehouse.
MY_WAREHOUSE
(optional) schema
Optional Name of schema.
MY_SCHEMA
(optional) params
Optional JDBC URL parameters that can be used for advanced configuration.
role=MY_ROLE
Creating Connections
First, create a file on your local computer containing the connection credentials. This file should also include type
, name
, config
, and credentials
. The config
and credentials
fields should contain fields that are specific to the connection being created.
Below is an example Snowflake connection:
Now that you've created the credentials file, use the CLI to create the connection
External OAuth
name
Display name of your choosing used to identify your connection within Gretel.
my-snowflake-connection
host
Fully qualified domain name (FQDN) used to establish connection to database server.
account_identifier.snowflakecomputing.com
username
Unique identifier associated with specific account authorized to access database.
john
password
Security credential to authenticate username.
...
database
Name of database to connect to.
MY_DATABASE
warehouse
Name of warehouse.
MY_WAREHOUSE
oauth_client_id
Unique identifier associated with the authentication application.
oauth_grant_type
method through which oauth token will be acquired
ex. "password"
oauth_scope
scope given to request token
oauth_url
endpoint to fetch access token from
(optional) schema
Optional Name of schema.
MY_SCHEMA
(optional) params
Optional JDBC URL parameters that can be used for advanced configuration.
role=MY_ROLE
Creating Connections
External OAuth is currently only supported via CLI/SDK.
First, create a file on your local computer containing the connection credentials. This file should also include type
, name
, config
, and credentials
. The config
and credentials
fields should contain fields that are specific to the connection being created.
Below is an example Snowflake External OAuth connection:
Now that you've created the credentials file, use the CLI to create the connection
Permissions
Source Connection Permissions
The Snowflake source action requires enough access to read from tables and access schema metadata. The following SQL script will create a Snowflake user suitable for a Gretel Snowflake source.
Destination Connection Permissions
The snowflake destination action requires enough permissions to write to the destination schema.
If your destination database and schema do not already exist, create those first.
Next configure a user for the Snowflake destination. This user must have OWNERSHIP
permissions in order to write data to the destination schema.
The following SQL script will create a Snowflake user suitable for a Gretel Snowflake destination.
Last updated
Was this helpful?