Snowflake
Table of Contents
- Alternative variants
- Standalone usage
- Usage with Meltano
- Capabilities
- Settings
-
account
-
dbname
-
user
-
password
-
warehouse
-
s3_bucket
-
stage
-
file_format
-
default_target_schema
-
aws_access_key_id
-
aws_secret_access_key
-
aws_session_token
-
aws_profile
-
s3_key_prefix
-
s3_endpoint_url
-
s3_region_name
-
s3_acl
-
batch_size_rows
-
flush_all_streams
-
parallelism
-
parallelism_max
-
default_target_schema_select_permission
-
schema_mapping
-
disable_table_cache
-
client_side_encryption_master_key
-
client_side_encryption_stage_object
-
add_metadata_columns
-
hard_delete
-
data_flattening_max_level
-
primary_key_required
-
validate_records
-
temp_dir
-
no_compression
-
query_tag
-
- Looking for help?
The
target-snowflake
Singer target
sends data into
Snowflake
after it was pulled from a source using a
Singer tap.
-
- Repository: https://github.com/transferwise/pipelinewise-target-snowflake
-
-
-
-
-
-
-
- Maintainer: Wise
- Meltano Stats:
-
-
-
-
Alternative variants
Multiple
variants
of target-snowflake
are available. This document describes the
default transferwise
variant, which is recommended for new
users.
Alternative variants are:
Standalone usage
Install the package using pip:
pip install pipelinewise-target-snowflake
For additional instructions, refer to the README in the repository.
Usage with Meltano
Install Meltano, create your Meltano project, and add the target to your project as a loader:
meltano add loader target-snowflake
For additional instructions, refer to the
Meltano-specific documentation for target-snowflake
.
Capabilities
Settings
account
Snowflake account name (i.e. rtXXXXX.eu-central-1)
dbname
Snowflake Database name
user
Snowflake User
password
Snowflake Password
warehouse
Snowflake virtual warehouse name
s3_bucket
S3 Bucket name
stage
Named external stage name created at pre-requirements section. Has to be a fully qualified name including the schema name
file_format
Named file format name created at pre-requirements section. Has to be a fully qualified name including the schema name.
default_target_schema
Name of the schema where the tables will be created, without database prefix. If schema_mapping
is not defined then every stream sent by the tap is loaded into this schema.
aws_access_key_id
S3 Access Key Id. If not provided, AWS_ACCESS_KEY_ID
environment variable or IAM role will be used
aws_secret_access_key
S3 Secret Access Key. If not provided, AWS_SECRET_ACCESS_KEY
environment variable or IAM role will be used
aws_session_token
AWS Session token. If not provided, AWS_SESSION_TOKEN
environment variable will be used
aws_profile
AWS profile name for profile based authentication. If not provided, AWS_PROFILE
environment variable will be used.
s3_key_prefix
A static prefix before the generated S3 key names. Using prefixes you can upload files into specific directories in the S3 bucket.
s3_endpoint_url
The complete URL to use for the constructed client. This is allowing to use non-native s3 account.
s3_region_name
Default region when creating new connections
s3_acl
S3 ACL name to set on the uploaded files
batch_size_rows
- Default:
100000
Maximum number of rows in each batch. At the end of each batch, the rows in the batch are loaded into Snowflake.
flush_all_streams
- Default:
false
Flush and load every stream into Snowflake when one batch is full. Warning: This may trigger the COPY command to use files with low number of records, and may cause performance problems.
parallelism
- Default:
0
The number of threads used to flush tables. 0 will create a thread for each stream, up to parallelism_max. -1 will create a thread for each CPU core. Any other positive number will create that number of threads, up to parallelism_max.
parallelism_max
- Default:
16
Max number of parallel threads to use when flushing tables.
default_target_schema_select_permission
Grant USAGE privilege on newly created schemas and grant SELECT privilege on newly created tables to a specific role or a list of roles. If schema_mapping
is not defined then every stream sent by the tap is granted accordingly.
schema_mapping
Useful if you want to load multiple streams from one tap to multiple Snowflake schemas. If the tap sends the stream_id
in <schema_name>-<table_name>
format then this option overwrites the default_target_schema
value. Note, that using schema_mapping
you can overwrite the default_target_schema_select_permission
value to grant SELECT permissions to different groups per schemas or optionally you can create indices automatically for the replicated tables.
disable_table_cache
- Default:
false
By default the connector caches the available table structures in Snowflake at startup. In this way it doesn’t need to run additional queries when ingesting data to check if altering the target tables is required. With disable_table_cache
option you can turn off this caching. You will always see the most recent table structures but will cause an extra query runtime.
client_side_encryption_master_key
When this is defined, Client-Side Encryption is enabled. The data in S3 will be encrypted, No third parties, including Amazon AWS and any ISPs, can see data in the clear. Snowflake COPY command will decrypt the data once it’s in Snowflake. The master key must be 256-bit length and must be encoded as base64 string.
client_side_encryption_stage_object
Required when client_side_encryption_master_key
is defined. The name of the encrypted stage object in Snowflake that created separately and using the same encryption master key.
add_metadata_columns
- Default:
false
Metadata columns add extra row level information about data ingestions, (i.e. when was the row read in source, when was inserted or deleted in snowflake etc.) Metadata columns are creating automatically by adding extra columns to the tables with a column prefix _SDC_
. The column names are following the stitch naming conventions documented at https://www.stitchdata.com/docs/data-structure/integration-schemas#sdc-columns. Enabling metadata columns will flag the deleted rows by setting the _SDC_DELETED_AT
metadata column. Without the add_metadata_columns
option the deleted rows from singer taps will not be recongisable in Snowflake.
hard_delete
- Default:
false
When hard_delete
option is true then DELETE SQL commands will be performed in Snowflake to delete rows in tables. It’s achieved by continuously checking the _SDC_DELETED_AT
metadata column sent by the singer tap. Due to deleting rows requires metadata columns, hard_delete
option automatically enables the add_metadata_columns
option as well.
data_flattening_max_level
- Default:
0
Object type RECORD items from taps can be loaded into VARIANT columns as JSON (default) or we can flatten the schema by creating columns automatically. When value is 0 (default) then flattening functionality is turned off.
primary_key_required
- Default:
true
Log based and Incremental replications on tables with no Primary Key cause duplicates when merging UPDATE events. When set to true, stop loading data if no Primary Key is defined.
validate_records
- Default:
false
Validate every single record message to the corresponding JSON schema. This option is disabled by default and invalid RECORD messages will fail only at load time by Snowflake. Enabling this option will detect invalid records earlier but could cause performance degradation.
temp_dir
(Default: platform-dependent) Directory of temporary CSV files with RECORD messages.
no_compression
- Default:
false
Generate uncompressed CSV files when loading to Snowflake. Normally, by default GZIP compressed files are generated.
query_tag
Optional string to tag executed queries in Snowflake. Replaces tokens schema
and table
with the appropriate values. The tags are displayed in the output of the Snowflake QUERY_HISTORY
, QUERY_HISTORY_BY_*
functions.
Looking for help?
If you're having trouble getting
target-snowflake
to work by itself or with
Meltano, look for an
existing issue in its repository, file a new issue,
or
join the Meltano Slack community
and ask for help in the #plugins-general
channel.
Found an issue on this page?
This page is generated from a YAML file that you can contribute changes to! It is also validated against a JSON Schema used for taps and targets.