MySQL loader for mkpipe.
Project description
mkpipe-loader-mysql
MySQL loader plugin for MkPipe. Writes Spark DataFrames into MySQL tables via JDBC.
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:
mysql_target:
variant: mysql
host: localhost
port: 3306
database: mydb
user: myuser
password: mypassword
Table Configuration
pipelines:
- name: pg_to_mysql
source: pg_source
destination: mysql_target
tables:
- name: public.orders
target_name: stg_orders
replication_method: full
batchsize: 10000
Write Strategy
Control how data is written to MySQL:
- name: public.orders
target_name: stg_orders
write_strategy: upsert # append | replace | upsert | merge
write_key: [id] # required for upsert/merge
| Strategy | MySQL Behavior |
|---|---|
append |
Plain INSERT via JDBC (default for incremental) |
replace |
Drop and recreate table, then insert (default for full) |
upsert |
INSERT ... ON DUPLICATE KEY UPDATE via temp table |
merge |
Same as upsert for MySQL |
Note:
upsert/mergerequireswrite_key. The target table must have a unique index/primary key on thewrite_keycolumns.
Write Parallelism & Throughput
- name: public.orders
target_name: stg_orders
replication_method: full
batchsize: 10000
write_partitions: 4
batchsize: rows per JDBC batchINSERT. MySQL handles 5,000–20,000 well.write_partitions: reduces concurrent JDBC connections viacoalesce(N).
All Table Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
string | required | Source table name |
target_name |
string | required | MySQL destination table name |
replication_method |
full / incremental |
full |
Replication strategy |
batchsize |
int | 10000 |
Rows per JDBC batch insert |
write_partitions |
int | — | Coalesce DataFrame to N partitions before writing |
write_strategy |
string | — | append, replace, upsert, merge |
write_key |
list | — | Key columns for upsert/merge (required) |
dedup_columns |
list | — | Columns used for mkpipe_id hash deduplication |
tags |
list | [] |
Tags for selective pipeline execution |
pass_on_error |
bool | false |
Skip table on error instead of failing |
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkpipe_loader_mysql-0.5.0.tar.gz.
File metadata
- Download URL: mkpipe_loader_mysql-0.5.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
937c30431c8c3f45edc9dcdc196d5cb886592f5876ca2f319846f9e5cd1b6320
|
|
| MD5 |
d6d2e0489b81fd124acc895a88489798
|
|
| BLAKE2b-256 |
262fc664b631da863859bcb678076b913ab45073af83b57e9cfd4627d53181e7
|
File details
Details for the file mkpipe_loader_mysql-0.5.0-py3-none-any.whl.
File metadata
- Download URL: mkpipe_loader_mysql-0.5.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b9246e2aed2e7f8481a2ac920232f6c5b32e9d22501e0b545ce59ddea37de78
|
|
| MD5 |
a3b847ab8338fea5cb8acd153a25c352
|
|
| BLAKE2b-256 |
c9a15c7257cece81f6ca178385d134a2cb0d1f4e322ac84cb266b5cb49cf7831
|