Lightweight spark-based migration runner for executing SQL migrations on Spark catalog tables in Cloudera Data Engineering (CDE).
Project description
cde-submit-migration
Lightweight Spark-based migration runner for executing SQL migrations on Spark catalog tables in Cloudera Data Engineering (CDE).
This repository contains a small CLI and a Spark job that can apply SQL migration files (single .sql file or a zipped folder containing multiple .sql files) to a Spark catalog. It was created to make it easy to run migrations either locally (for testing) or by submitting the job through CDE's cde spark submit command.
Highlights
- Run a single SQL migration file or a folder (zipped automatically) containing multiple ordered
.sqlfiles. - Local mode (uses a local path-based Iceberg catalog) for development and testing.
- Integration with Cloudera Data Engineering (
cde spark submit) for production runs.
Requirements
- Python 3.11 or later
pyspark==3.5.1
Install
uv tool install cde-submit-migration
pip install cde-submit-migration
After installation you should have following console command available:
- submit-cde-migration to perform migration on CDE environment,
- submit-local-migration to perform migration in local environment (for testing purposes)
To upgrade package to the latest version use following commands:
uv tool upgrade cde-submit-migration
pip install --upgrade cde-submit-migration
Usage
submit-cde-migration --path path/to/migrations --db target_database --profile my-cde-profile
submit-local-migration --path path/to/migrations --db target_database
Notes on arguments:
--path— path to a single.sqlfile or a folder containing.sqlfiles. When passing a folder in non-local mode, the folder is copied and zipped before submission.--db— target database name to use as the current catalog database. If the database does not exist, it will be created.--profile— optional CDE configuration profile name used when callingcde spark submit.
Project structure
src/cde_submit_migration/main.py— CLI entrypoint that either runs locally or packages and submits to CDE.src/cde_submit_migration/migration.py— Spark job that executes SQL migration(s).pyproject.toml— project metadata and dependencies.
Troubleshooting
- If
cde spark submitis not in your PATH, the CDE mode will fail. Make sure thecdeCLI is installed and configured in the environment you use to runsubmit-cde-migration. - If you see Spark/Java version incompatibilities when running locally, verify your local Spark/PySpark installation matches the expected runtime (the project pins
pyspark==3.5.1).
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 cde_submit_migration-0.14.0.tar.gz.
File metadata
- Download URL: cde_submit_migration-0.14.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78957714c5a4a8bf5d87864a7023dfe5e000122a2178da652cc4de03dc9ade7a
|
|
| MD5 |
2609d10e0fd87a811730badb5b922428
|
|
| BLAKE2b-256 |
fad864be488cd8aabe6dbe7e75c3a10d02f7aeda8780ec24a14084dfe3cce8be
|
File details
Details for the file cde_submit_migration-0.14.0-py3-none-any.whl.
File metadata
- Download URL: cde_submit_migration-0.14.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76d99aa2acedb7f3ffe882dbc875ed2713aec509d418693d919495c7319d4ef2
|
|
| MD5 |
13f79ff14c860082279d3b750a60b77d
|
|
| BLAKE2b-256 |
84fb7e0fcb05d6fcbeda0cc0da24dd2d809bbc452c097831d69bc171c71ea805
|