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:
make venv
Configuration
- Create a
config.json
file with connection details to snowflake, here is a sample config file.
Note: tables
is a mandatory parameter as well to avoid a long-running catalog discovery process.
Please specify fully qualified table and view names and only that ones that you need to extract otherwise you can
end up with very long running discovery mode of this tap. Discovery mode is analysing table structures but
Snowflake doesn't like selecting lot of rows from INFORMATION_SCHEMA
or running SHOW
commands that returns lot of
rows. Please be as specific as possible.
-
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
Authentication Methods
You can either use basic user/password authentication or Key Pair authentication.
User / Password authentication
Populate user
and password
in the config.json
file
Key Pair authentication
To use key pair authentication, omit the password
and instead provide the private_key_path
to the unencrypted version of the private key and, optionally, the private_key_passphrase
.
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=<snowflake-password>
export TAP_SNOWFLAKE_PRIVATE_KEY_PATH=<snowflake-pk-path>
export TAP_SNOWFLAKE_PRIVATE_KEY_PASSPHRASE=<snowflake-passphrase>
export TAP_SNOWFLAKE_WAREHOUSE=<snowflake-warehouse>
- Install python dependencies
make venv
- To run unit tests:
PS: There are no unit tests at the time of writing this document
make unit_test
- To run Integration tests
make integration_test
To run formatting and linting:
make venv format pylint
License
Apache License Version 2.0
See LICENSE to see the full text.
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
Built Distribution
File details
Details for the file pipelinewise-tap-snowflake-3.0.0.tar.gz
.
File metadata
- Download URL: pipelinewise-tap-snowflake-3.0.0.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6628992a58772ed759d3d96b2a987567a61b39ee831c422057cdc6b01df6356d |
|
MD5 | 5f0d8d103ce7f7bc7609113b62a7c1f8 |
|
BLAKE2b-256 | 8b31499187a786825e068399d12a9369a211ff581cdc9cf125690fa4dab56ab7 |
File details
Details for the file pipelinewise_tap_snowflake-3.0.0-py3-none-any.whl
.
File metadata
- Download URL: pipelinewise_tap_snowflake-3.0.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12150894aafa34929077e3f0fd0ab58a6dd0dbc640498bd2d44ee276d560a23d |
|
MD5 | c37a5e8da5925dd42693ab05f138eff1 |
|
BLAKE2b-256 | 247b5d1d8e2635b247f335f03b6cbe81bce8fc8cebef4382b81b8ee04d2e516f |