Target Snowflake
A Singer Snowflake target, for use with Singer streams generated by Singer taps.
Snowflake Connector
Install
pip install target-snowflake
Usage
-
Follow the Singer.io Best Practices for setting up separate
tapandtargetvirtualenvs to avoid version conflicts. -
Create a config file at
~/singer.io/target_snowflake_config.jsonwith Snowflake connection information and target Snowflake schema and warehouse.{ "snowflake_account": "https://XXXXX.snowflakecomputing.com", "snowflake_username": "myuser", "snowflake_role": "myrole", "snowflake_password": "1234", "snowflake_database": "my_analytics", "snowflake_schema": "mytapname", "snowflake_warehouse": "dw" }
1. Run `target-snowfkajke` against a [Singer](https://singer.io) tap.
```bash
~/.virtualenvs/tap-something/bin/tap-something \
| ~/.virtualenvs/target-snowflake/bin/target-snowflake \
--config ~/singer.io/target_snowflake_config.json >> state.json
If you are running windows, the following is equivalent:
venvs\tap-exchangeratesapi\Scripts\tap-exchangeratesapi.exe | ^
venvs\target-snowflake\Scripts\target-snowlfake.exe ^
--config target_snowflake_config.json
Config.json
The fields available to be specified in the config file are specified here.
| Field | Type | Default | Details |
|---|---|---|---|
snowflake_account |
["string"] |
N/A |
ACCOUNT might require the region and cloud platform where your account is located, in the form of: <your_account_name>.<region_id>.<cloud> (e.g. xy12345.east-us-2.azure) Refer to Snowflake's documentation about Account |
snowflake_username |
["string"] |
N/A |
|
snowflake_password |
["string", "null"] |
null |
|
snowflake_role |
["string"] |
null |
If not specified, Snowflake will use the user's default role. |
snowflake_database |
["string"] |
N/A |
|
snowflake_authenticator |
["string"] |
"snowflake" |
Speifies the authentication provider for snowflake to use. Valud options are the internal one ("snowflake"), a browser session ("externalbrowser"), or Okta ("https://<your_okta_account_name>.okta.com"). See the snowflake docs for more details. |
snowflake_schema |
["string", "null"] |
"PUBLIC" |
|
snowflake_warehouse |
["string"] |
N/A |
|
invalid_records_detect |
["boolean", "null"] |
true |
Include false in your config to disable crashing on invalid records |
invalid_records_threshold |
["integer", "null"] |
0 |
Include a positive value n in your config to allow at most n invalid records per stream before giving up. |
disable_collection |
["string", "null"] |
false |
Include true in your config to disable Singer Usage Logging. |
logging_level |
["string", "null"] |
"INFO" |
The level for logging. Set to DEBUG to get things like queries executed, timing of those queries, etc. See Python's Logger Levels for information about valid values. |
persist_empty_tables |
["boolean", "null"] |
False |
Whether the Target should create tables which have no records present in Remote. |
state_support |
["boolean", "null"] |
True |
Whether the Target should emit STATE messages to stdout for further consumption. In this mode, which is on by default, STATE messages are buffered in memory until all the records that occurred before them are flushed according to the batch flushing schedule the target is configured with. |
target_s3 |
["object", "null"] |
N/A |
When included, use S3 to stage files. See S3 below |
S3 Config.json
| Field | Type | Default | Details |
|---|---|---|---|
aws_access_key_id |
["string"] |
N/A |
|
aws_secret_access_key |
["string"] |
N/A |
|
bucket |
["string"] |
N/A |
Bucket where staging files should be uploaded to. |
key_prefix |
["string", "null"] |
"" |
Prefix for staging file uploads to allow for better delineation of tmp files |
Limitations
- Snowflake SQL Identifiers:
- Although Snowflake supports quoted identifiers to have non-alphanumeric values,
target-snowflakelimits identifiers to uppercase alphanumerics, and underscores - This is done to make querability/useability in Snowflake simpler, so as to not require users to have to use sometimes cumbersome quotes to query their data
- Although Snowflake supports quoted identifiers to have non-alphanumeric values,
- Requires a JSON Schema for every stream.
- Only string, string with date-time format, integer, number, boolean,
object, and array types with or without null are supported. Arrays can
have any of the other types listed, including objects as types within
items.
- Example of JSON Schema types that work
['number']['string']['string', 'null']['string', 'integer']['integer', 'number']
- Exmaple of JSON Schema types that DO NOT work
['any']['null']
- Example of JSON Schema types that work
- JSON Schema combinations such as
anyOfandallOfare not supported. - JSON Schema $ref is partially supported:
- NOTE: The following limitations are known to NOT fail gracefully
- Presently you cannot have any circular or recursive
$refs $refs must be present within the schema:- URI's do not work
- if the
$refis broken, the behaviour is considered unexpected
- Any values which are the
string\\Nwill be streamed to Snowflake as the literalnull
Sponsorship
Target Snowflake is sponsored by Data Mill (Data Mill Services, LLC) datamill.co.
Data Mill helps organizations utilize modern data infrastructure and data science to power analytics, products, and services.
Copyright Data Mill Services, LLC 2018
Metadata
Release files for target-snowflake 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| target-snowflake-0.2.4.tar.gz | 15.1 kB | Without provenance | Details for target-snowflake-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| target_snowflake-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for target_snowflake-0.2.4-py3-none-any.whl |
Total release size: 40.4 kB
Release files / target-snowflake-0.2.4.tar.gz
| Download URL | target-snowflake-0.2.4.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09670035c023606646ceeba498fb978549150de272d0783ce763231214cda6ec
|
|
BLAKE2b-256 checksum How to use checksums |
23a25b538a1bf49a06d32d33e70022a12e7623dc3375452fe5b9e4396f2c3a7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Release files / target_snowflake-0.2.4-py3-none-any.whl
| Download URL | target_snowflake-0.2.4-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4872044616c74da2279ee94728cdc7159fac7a5c80479fec161b7aaf0861b76
|
|
BLAKE2b-256 checksum How to use checksums |
6c9252b365921de6b242f00ef8a3b19d7123d3a42598a44cbd39182e41036f36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for target-snowflake 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.