Configuration for Snowpipe Streaming¶
Snowpipe Streaming properties¶
Configure the API connection settings in a profile.json
file. The properties are described in this topic.
As shown in the Java example (https://github.com/snowflakedb/snowflake-ingest-java/blob/master/src/main/java/net/snowflake/ingest/streaming/example/SnowflakeStreamingIngestExample.java) (GitHub), you can load the settings from profile.json
by specifying the file path as the input to the variable PROFILE_PATH
.
Required properties¶
authorization_type
Configure the authentication and authorization method for the user. You can use one of the following methods:
JWT
: key pair authentication with JSON Web Token (JWT). This is the default method. Ifauthorization_type
is not configured, the default methodJWT
is used. Configure the followingprivate_key
for key pair authentication:private_key
Private key to authenticate the user. Include only the key, not the header or footer. If the key is split across multiple lines, remove the line breaks.You can provide an unencrypted key, or you can provide an encrypted key and provide the
snowflake.private.key.passphrase
parameter to enable Snowflake to decrypt the key. Use this parameter if and only if thesnowflake.private.key
parameter value is encrypted.
OAuth
: Snowflake OAuth. This option is only available with Snowflake Ingest SDK versions 2.0.3 and later. Configure the following parameters for Snowflake OAuth in theprofile.json
file:oauth_client_id
: The client ID of the OAuth integration.oauth_client_secret
: The client secret of the OAuth integration.oauth_refresh_token
: A valid refresh token of the OAuth integration.
To support token refresh on Snowflake/OKTA OAuth, you must configure three parameters:
oauth_client_id
,oauth_client_secret
, andoauth_refresh_token
. However, if you use a customized API endpoint for OAuth that doesn’t require these values in the token refresh request, you can fill in the fields for these parameters with any placeholders.
url
URL for accessing your Snowflake account. This URL must include your account identifier. Note that the protocol (
https://
) and port number are optional.Note that
url
is not required if you are already using the Snowflake Ingest SDK and have set thehost
,scheme
, andport
properties in theprofile.json
file.user
User login name for the Snowflake account.
Optional properties¶
snowflake.private.key.passphrase
Passphrase to decrypt the private key when the key is encrypted. For information, see Using key pair authentication and key rotation (in this topic).
role
Access control role to use for the session after connecting to Snowflake.
Note that the
role
property is optional for Snowflake Ingest SDK versions 2.0.3 and later. It is required for earlier Ingest SDK versions.
Examples¶
For a simple example that shows how the client SDK could be used to build a Snowpipe Streaming application, see this Java file (https://github.com/snowflakedb/snowflake-ingest-java/blob/master/src/main/java/net/snowflake/ingest/streaming/example/SnowflakeStreamingIngestExample.java) (GitHub).
Quick start examples:
Streaming Data Integration with Snowflake (https://quickstarts.snowflake.com/guide/data_engineering_streaming_integration/index.html)
Getting Started with Snowpipe Streaming and Amazon MSK (https://quickstarts.snowflake.com/guide/getting_started_with_snowpipe_streaming_aws_msk/index.html)
Snowpipe Streaming and Dynamic Tables for Real-Time Ingestion (CDC Use Case) (https://quickstarts.snowflake.com/guide/CDC_SnowpipeStreaming_DynamicTables)