Connect Soda to Snowflake
Last modified on 26-Jan-23
For Soda to run quality scans of your data, you must configure it to connect to your data source.
- For Soda Core, add the connection configurations to your
configuration.yml
file. Read more. - For Soda Cloud, add the connection configurations to step 3 of the New Data Source workflow. Read more.
Configuration
data_source my_datasource_name:
type: snowflake
connection:
username:
password:
account:
database:
warehouse:
connection_timeout:
role: PUBLIC
client_session_keep_alive: true
authenticator: externalbrowser
session_parameters:
QUERY_TAG: soda-queries
QUOTED_IDENTIFIERS_IGNORE_CASE: false
schema: public
Property | Required | Notes |
---|---|---|
type | required | |
username | required | Consider using system variables to retrieve this value securely using, for example, ${SNOWFLAKE_USER} . |
password | required | Consider using system variables to retrieve this value securely using, for example, ${SNOWFLAKE_PASSWORD} . |
account | required | Consider using system variables to retrieve this value securely using, for example, ${SNOWFLAKE_ACCOUNT} . |
database | required | |
schema | required | |
warehouse | required | |
connection_timeout | required | |
role | optional | See Snowflake System-Defined Roles for details. |
client_session_keep_alive | optional | Use this parameter with a boolean option to keep the session active, even with no user activity. |
authenticator 1 | optional | Add an authenticator paramater with value externalbrowser to authenticate the connection to your Snowflake data source using any SAML 2.0-compliant identity provider (IdP) such as Okta or OneLogin. |
other params | optional | You can pass any other Snowflake paramters you wish by adding the key:value pairs to your Snowflake connection configuration. See Snowflake Python Connector API documentation> for a list of passable parameters. |
QUERY_TAG | optional | See QUERY_TAG in Snowflake documentation. |
QUOTED_IDENTIFIERS_ IGNORE_CASE | optional | See QUOTED_IDENTIFIERS_IGNORE_CASE in Snowflake documentation. |
schema | required |
1 Use this parameter when adding Snowflake connection configurations to a configuration.
yml file. However, if you are adding connection configuration details directly in Soda Cloud (connecting to your Snowflake data source via a Soda Agent) to authenticate using Okta, you must follow the instructions documented by Snowflake for Native SSO - Okta Only.
Private key authentication
You can use the private_key
parameter to specify key-value pairs for key pair authentication. In you configuration YML file, add the parameter as per the following example:
private_key: |
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIExxxxxxxxxxxxxxxxxxxxucRqSZaS
...
-----END ENCRYPTED PRIVATE KEY-----
Test the data source connection
To confirm that you have correctly configured the connection details for the data source(s) in your configuration YAML file, use the test-connection
command. If you wish, add a -V
option to the command to returns results in verbose mode in the CLI.
soda test-connection -d my_datasource -c configuration.yml -V
Supported data types
Category | Data type |
---|---|
text | CHAR, VARCHAR, CHARACTER, STRING, TEXT |
number | NUMBER, INT, INTEGER, BIGINT, SMALLINT, TINYINT, BYTEINT, FLOAT, FLOAT4, FLOAT8, DOUBLE, DOUBLE PRECISION, REAL |
time | DATE, DATETIME, TIME, TIMESTAMP, TIMESTAMPT_LTZ, TIMESTAMP_NTZ, TIMESTAMP_TZ |
Was this documentation helpful?
What could we do to improve this page?
- Suggest a docs change in GitHub.
- Share feedback in the Soda community on Slack.
Last modified on 26-Jan-23