Snowflake
Connect & Ingest data from / to a Snowflake database
Setup
The following credentials keys are accepted:
account(required) -> The hostname or account the instance (eg.pua90768.us-east-11)user(required) -> The username to access the instancedatabase(required) -> The database name of the instancepassword(optional) -> The password to access the instanceschema(optional) -> The default schema to userole(optional) -> The role to access the instancewarehouse(optional) -> The warehouse to usepasscode(optional) -> Specifies the passcode provided by Duo when using multi-factor authentication (MFA) for login.authenticator(optional) -> Specifies the authenticator to use to login (e.g.snowflake,snowflake_jwt,externalbrowser,oauth,programmatic_access_token,username_password_mfa).token(optional since v1.5.1) -> Specifies the token for OAuth or PAT authentication. Required when usingauthenticator=programmatic_access_token.private_key(optional) -> Specifies the private key to use forsnowflake_jwtauthentication. Accepts a PEM-encoded key body, a Base64-encoded DER key (convenient for CI/CD environment variables, no PEM wrapping needed), or a file path to a key file.private_key_passphrase(optional) -> Specifies the private key file passphrase.max_chunk_download_workers(optional) -> Specifies the Maximum Number of Result Set Chunk Downloader (integer).custom_json_decoder_enabled(optional) -> Specifies to use the Custom JSON Decoder for Parsing Result Set (trueorfalse).internal_stage(optional) -> Specifies a custom internal stage to use for bulk operations. If not provided, Sling will attempt to create a stage in the default schema namedSLING_SCHEMA.SLING_STAGING.copy_method(optional) -> Specifies to use the platform to use for loading/unloading (DEFAULT,AWS,AZURE). ForAWSorAZURE, you'll need to provide the necessary credentials, such asaws_bucket,aws_access_key_idandaws_secret_access_key, for AWS, orazure_account,azure_containerandazure_sas_svc_urlfor AZURE.use_adbc(optional) -> Enable Arrow Database Connectivity (ADBC) driver for high-performance data transfer. See ADBC for setup and details. (v1.5.2+)adbc_uri(optional) -> Override the automatically constructed ADBC connection URI when usinguse_adbc=true.
Using sling conns
Here are examples of setting a connection named SNOWFLAKE. We must provide the type=snowflake property:
Environment Variable
See here to learn more about the .env.sling file.
Sling Env File YAML
See here to learn more about the sling env.yaml file.
Troubleshooting
Key-Pair Authentication
Error: only PKCS #5 v2.0 supported
This error, or only PBES2 supported, has two causes:
You set
private_key_passphrase, but the key is not an encrypted PKCS#8 key. Removeprivate_key_passphraseif the key starts with-----BEGIN PRIVATE KEY-----.The key uses old PKCS#5 v1.5 encryption. This occurs when you encrypt a key with
openssl pkcs8 -topk8 -v1 .... Create the key again with the-v2option, as shown below.
Create a new key pair
Do these steps to create a key in the correct format.
Step 1. Create the private key. Use one of the two commands.
For an unencrypted key:
For an encrypted key, the -v2 option is necessary. It selects PBES2 encryption:
OpenSSL asks for a passphrase. Keep this passphrase for the private_key_passphrase property.
Step 2. Make sure the file starts with the correct line:
The output must be -----BEGIN PRIVATE KEY----- or -----BEGIN ENCRYPTED PRIVATE KEY-----.
Step 3. Create the public key:
If the private key is encrypted, OpenSSL asks for the passphrase.
Step 4. Assign the public key to the Snowflake user. Remove the header, the footer, and all new lines from the value:
Step 5. Set the Sling connection:
Step 6. Test the connection:
Use a key in an environment variable
To put a key in an environment variable, encode the DER body with base64. This removes the new lines:
Then use the variable in the connection:
If you are facing issues connecting, please reach out to us at support@slingdata.io, on discord or open a Github Issue here.
Last updated
Was this helpful?