The target-snowflake loader loads extracted data into a Snowflake data warehouse.

Alternative variants

Multiple variants of target-snowflake are available. This document describes the meltano variant.

Alternative options are transferwise (default) and datamill-co.

Getting Started

Prerequisites

If you haven’t already, follow the initial steps of the Getting Started guide:

  1. Install Meltano
  2. Create your Meltano project
  3. Add an extractor to pull data from a source

Installation and configuration

Using the Command Line Interface

  1. Add the meltano variant of the target-snowflake loader to your project using meltano add:

     meltano add loader target-snowflake --variant meltano
    
  2. Configure the settings below using meltano config.

Using Meltano UI

  1. Start Meltano UI using meltano ui:

     meltano ui
    
  2. Open the Loaders interface at http://localhost:5000/loaders.
  3. Click the arrow next to the “Add to project” button for “Snowflake”.
  4. Choose “Add variant ‘meltano’”.
  5. Configure the settings below in the “Configuration” interface that opens automatically.

Next steps

Follow the remaining step of the Getting Started guide:

  1. Run a data integration (EL) pipeline

If you run into any issues, learn how to get help.

Settings

target-snowflake requires the configuration of the following settings:

These and other supported settings are documented below. To quickly find the setting you’re looking for, use the Table of Contents in the sidebar.

Minimal configuration

A minimal configuration of target-snowflake in your meltano.yml project file will look like this:

plugins:
  loaders:
  - name: target-snowflake
    variant: meltano
    config:
      account: my_account
      username: my_username
      role: MY_ROLE
      database: MY_DATABASE
      warehouse: MY_WAREHOUSE
      # schema: MY_SCHEMA    # override if default (see below) is not appropriate

Sensitive values are most appropriately stored in the environment or your project’s .env file:

export TARGET_SNOWFLAKE_PASSWORD=my_password

Account

  • Name: account
  • Environment variable: TARGET_SNOWFLAKE_ACCOUNT, alias: SF_ACCOUNT, SNOWFLAKE_ACCOUNT

Account Name in Snowflake (https://<account>.snowflakecomputing.com)

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set account <account>

export TARGET_SNOWFLAKE_ACCOUNT=<account>

Username

The username you use for logging in

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set username <username>

export TARGET_SNOWFLAKE_USERNAME=<username>

Password

  • Name: password
  • Environment variable: TARGET_SNOWFLAKE_PASSWORD, alias: SF_PASSWORD, SNOWFLAKE_PASSWORD

The password you use for logging in

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set password <password>

export TARGET_SNOWFLAKE_PASSWORD=<password>

Role

Role to be used for loading the data, e.g. LOADER. Also this role is GRANTed usage to all tables and schemas created

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set role <role>

export TARGET_SNOWFLAKE_ROLE=<role>

Database

  • Name: database
  • Environment variable: TARGET_SNOWFLAKE_DATABASE, alias: SF_DATABASE, SNOWFLAKE_DATABASE

The name of the Snowflake database you want to use

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set database <database>

export TARGET_SNOWFLAKE_DATABASE=<database>

Warehouse

  • Name: warehouse
  • Environment variable: TARGET_SNOWFLAKE_WAREHOUSE, alias: SF_WAREHOUSE, SNOWFLAKE_WAREHOUSE

The name of the Snowflake warehouse you want to use

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set warehouse <warehouse>

export TARGET_SNOWFLAKE_WAREHOUSE=<warehouse>

Schema

  • Name: schema
  • Environment variable: TARGET_SNOWFLAKE_SCHEMA, alias: SF_SCHEMA, SNOWFLAKE_SCHEMA
  • Default: $MELTANO_EXTRACT__LOAD_SCHEMA, which will expand to the value of the load_schema extra for the extractor used in the pipeline, which defaults to the extractor’s namespace, e.g. tap_gitlab for tap-gitlab. Values are automatically converted to uppercase before they’re passed on to the plugin, so tap_gitlab becomes TAP_GITLAB.

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set schema <schema>

export TARGET_SNOWFLAKE_SCHEMA=<schema>

Batch Size

How many records are sent to Snowflake at a time?

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set batch_size 10000

export TARGET_SNOWFLAKE_BATCH_SIZE=10000

Timestamp Column

  • Name: timestamp_column
  • Environment variable: TARGET_SNOWFLAKE_TIMESTAMP_COLUMN
  • Default: __loaded_at

Name of the column used for recording the timestamp when Data are uploaded to Snowflake.

How to use

Manage this setting using Meltano UI, meltano config, or an environment variable:

meltano config target-snowflake set timestamp_column <column>

export TARGET_SNOWFLAKE_TIMESTAMP_COLUMN=<column>