Singer.io tap for extracting data from Snowflake - PipelineWise compatible
Project description
pipelinewise-tap-snowflake
Singer tap that extracts data from a Snowflake database and produces JSON-formatted data following the Singer spec.
This is a PipelineWise compatible tap connector.
How to use it
The recommended method of running this tap is to use it from PipelineWise. When running it from PipelineWise you don't need to configure this tap with JSON files and most of things are automated. Please check the related documentation at Tap Snowflake
If you want to run this Singer Tap independently please read further.
Install and Run
First, make sure Python 3 is installed on your system or follow these installation instructions for Mac or Ubuntu.
It's recommended to use a virtualenv:
python3 -m venv venv
pip install pipelinewise-tap-snowflake
or
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install .
Configuration
-
Create a
config.json
file with connection details to snowflake.{ "account": "rtxxxxx.eu-central-1", "dbname": "database_name", "user": "my_user", "password": "password", "warehouse": "my_virtual_warehouse", "filter_dbs": "database_name", "filter_schemas": "schema1,schema2" }
filter_dbs
and filter_schemas
are optional.
-
Run it in discovery mode to generate a
properties.json
-
Edit the
properties.json
and select the streams to replicate -
Run the tap like any other singer compatible tap:
tap-snowflake --config config.json --properties properties.json --state state.json
Discovery mode
The tap can be invoked in discovery mode to find the available tables and columns in the database:
$ tap-snowflake --config config.json --discover
A discovered catalog is output, with a JSON-schema description of each table. A source table directly corresponds to a Singer stream.
Replication methods
The two ways to replicate a given table are FULL_TABLE
and INCREMENTAL
.
Full Table
Full-table replication extracts all data from the source table each time the tap is invoked.
Incremental
Incremental replication works in conjunction with a state file to only extract new records each time the tap is invoked. This requires a replication key to be specified in the table's metadata as well.
To run tests:
- Define environment variables that requires running the tests
export TAP_SNOWFLAKE_ACCOUNT=<snowflake-account-name>
export TAP_SNOWFLAKE_DBNAME=<snowflake-database-name>
export TAP_SNOWFLAKE_USER=<snowflake-user>
export TAP_SNOWFLAKE_PASSWORD=<snowfale-password>
export TAP_SNOWFLAKE_WAREHOUSE=<snowflake-warehouse>
- Install python dependencies in a virtual env and run nose unit and integration tests
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install .
pip install nose
- To run unit tests:
nosetests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for pipelinewise-tap-snowflake-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8696fc05636d684f89d818886dd1864544a0ba311429be4563b9815bfedd72b6 |
|
MD5 | 8b158a3030be57ab9d3b7241de3f9e09 |
|
BLAKE2b-256 | 16b3c016b85dcd77ce6a014fb6f3ae061400139a0b12aa186fd03cc3922ca94b |