mkpipe-extractor-snowflake
Snowflake extractor plugin for MkPipe. Reads Snowflake tables using the native Snowflake Spark connector (spark-snowflake), which transfers data via internal staging (S3/Azure/GCS) — significantly faster than JDBC for large datasets.
Documentation
For more detailed documentation, please visit the GitHub repository.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Connection Configuration
connections:
snowflake_source:
variant: snowflake
host: myaccount.snowflakecomputing.com
port: 443
database: MY_DATABASE
schema: MY_SCHEMA
user: myuser
password: mypassword
warehouse: MY_WAREHOUSE
With RSA key pair authentication:
connections:
snowflake_source:
variant: snowflake
host: myaccount.snowflakecomputing.com
port: 443
database: MY_DATABASE
schema: MY_SCHEMA
user: myuser
warehouse: MY_WAREHOUSE
private_key_file: /path/to/rsa_key.p8
private_key_file_pwd: mypassphrase # omit if key is unencrypted
Table Configuration
pipelines:
- name: snowflake_to_pg
source: snowflake_source
destination: pg_target
tables:
- name: MY_SCHEMA.EVENTS
target_name: stg_events
replication_method: full
fetchsize: 100000
Incremental Replication
- name: MY_SCHEMA.EVENTS
target_name: stg_events
replication_method: incremental
iterate_column: UPDATED_AT
iterate_column_type: datetime
partitions_column: ID
partitions_count: 8
fetchsize: 50000
Custom SQL
- name: MY_SCHEMA.EVENTS
target_name: stg_events
replication_method: full
custom_query: "SELECT ID, USER_ID, EVENT_TYPE, CREATED_AT FROM MY_SCHEMA.EVENTS WHERE {query_filter}"
Use {query_filter} as a placeholder — it is replaced with the incremental WHERE clause on incremental runs, or WHERE 1=1 on full runs.
Read Parallelism
Snowflake extractor uses the native Snowflake Spark connector with Spark's partition support. For large tables, set partitions_column and partitions_count to read in parallel:
- name: MY_SCHEMA.EVENTS
target_name: stg_events
replication_method: incremental
iterate_column: UPDATED_AT
iterate_column_type: datetime
partitions_column: ID # numeric column to split on
partitions_count: 8 # number of parallel Spark partitions
fetchsize: 50000
How it works
- Spark reads the min/max of
partitions_columnand divides the range intopartitions_countequal slices - Each slice is fetched by a separate Spark task via the Snowflake connector
fetchsizecontrols how many rows are fetched per round-trip
Performance Notes
- Full replication: partitioning is not applied (only works with
incremental). partitions_columnshould be a numeric column with good distribution (e.g. surrogate key).- Snowflake Warehouse size is the primary performance lever — a larger warehouse processes queries faster regardless of JDBC partitioning.
- Keep
fetchsizehigh (50,000–200,000) to minimize round-trips; Snowflake handles large result sets efficiently.
All Table Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
string | required | Snowflake table name (include schema if needed) |
target_name |
string | required | Destination table name |
replication_method |
full / incremental |
full |
Replication strategy |
iterate_column |
string or list | — | Column(s) for incremental watermark. String for single column or SQL expression, list for multi-column OR logic |
iterate_column_type |
int / datetime |
— | Type of iterate_column |
partitions_column |
string | same as iterate_column |
Column to split Spark reads on |
partitions_count |
int | 10 |
Number of parallel Spark partitions |
fetchsize |
int | 100000 |
Rows per JDBC fetch |
custom_query |
string | — | Override SQL with {query_filter} placeholder |
custom_query_file |
string | — | Path to SQL file (relative to sql/ dir) |
write_partitions |
int | — | Coalesce to N partitions before writing |
tags |
list | [] |
Tags for selective pipeline execution |
pass_on_error |
bool | false |
Skip table on error instead of failing |
Metadata
Release files for mkpipe-extractor-snowflake 0.12.0
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 | |
|---|---|---|---|---|
| mkpipe_extractor_snowflake-0.12.0.tar.gz | 10.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkpipe_extractor_snowflake-0.12.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.5 kB
Release files / mkpipe_extractor_snowflake-0.12.0.tar.gz
| Download URL | mkpipe_extractor_snowflake-0.12.0.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
142d48aa05c46ea90b364865e628c547ad191e129435e908d0b533ebb41ae98a
|
|
BLAKE2b-256 checksum How to use checksums |
aef9b8f3d7be793cb97f5b76c599781cb26dced8f9a593ae5ff85a21ea1534bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / mkpipe_extractor_snowflake-0.12.0-py3-none-any.whl
| Download URL | mkpipe_extractor_snowflake-0.12.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
deffead406931664fc6517b2a1eb6f8eeed74b1791475b3d47d1eaacf195ef2d
|
|
BLAKE2b-256 checksum How to use checksums |
9a4955ef85f0077cf1c416770da53b419b360d2e75cd520f1feb0ab45980e729
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Security for mkpipe-extractor-snowflake 0.12.0
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.