This document describes how to make a release of Apache DataFusion Spark (the datafusion-spark crate).
Under the Apache governance model, an official release is a signed source tarball that the DataFusion PMC has approved. The datafusion-spark crate is published to crates.io from the approved tarball after the vote passes.
The steps are:
The scripts in this directory are:
| Script | Purpose |
|---|---|
generate-changelog.py | Generates the changelog from GitHub PRs merged between two git refs |
create-tarball.sh | Creates, signs, and uploads the RC tarball, and prints the vote email |
verify-release-candidate.sh | Verifies the signature and checksums of an RC, then builds and tests it |
release-tarball.sh | Moves an approved RC from the dev area to the release area in svn |
run-rat.sh | Runs the Apache RAT license check on the repository or on a tarball |
datafusion-spark follows Semantic Versioning, with its major version tied to DataFusion's:
datafusion-spark 56.x depends on DataFusion 56.x, and datafusion-spark moves to 57.0.0 only when it moves to DataFusion 57.The version is set once for the whole workspace in the root Cargo.toml ([workspace.package] version).
New Spark-compatible functions and fixes land here between DataFusion major releases. So datafusion-spark is released from main as often as needed within a major version, rather than only alongside DataFusion releases.
main stays on DataFusion 56, and releases from it are 56.x, until DataFusion 57.0.0 is released. Then main moves to DataFusion 57, and its next release is 57.0.0.
DataFusion 56.0.0 publishes datafusion-spark 56.0.0 from branch-56 in apache/datafusion. Later 56.x releases of datafusion-spark come from this repository, so a DataFusion 56.x patch release should not publish datafusion-spark again.
A 56.x release must not break code that builds against an earlier 56.x release. Until main moves to the next DataFusion major version, pull requests must not, for example:
#[non_exhaustive]New public items, new functions and new #[non_exhaustive] fields or variants are fine. A change to a function's result that makes it match Spark is a bug fix, not a breaking change, and goes in the changelog.
A breaking change waits until main moves to the next DataFusion major version. Often it can be avoided by adding a new item next to the old one and deprecating the old one with #[deprecated], which is not a breaking change.
Before a release, check the public API against the previous release with cargo-semver-checks:
cargo semver-checks -p datafusion-spark --baseline-version <previous release>
crates.io does not accept crates with git dependencies. During development main may depend on a DataFusion git branch (for example branch = "branch-56"); before a release these must be changed to the matching DataFusion release published on crates.io.
Only committers can upload release candidates, and only PMC members can finalize a release.
You need:
A GPG key for signing, with the public key added to both DataFusion KEYS files:
See Add your GPG key to the KEYS files below.
svn, with your Apache credentials.
Java, for the Apache RAT license check.
Python 3 with PyGitHub (pip3 install PyGitHub), for the changelog.
A GitHub personal access token for the changelog script. It only needs read access to public repositories.
See https://infra.apache.org/release-signing.html#generate for generating a key. Committers can add their key to the dev KEYS file with their ASF account. Only PMC members can commit to the release KEYS file, so ask one if you cannot.
Follow the instructions at the top of each KEYS file. For example, for the dev file:
svn co --depth files https://dist.apache.org/repos/dist/dev/datafusion dev-datafusion cd dev-datafusion (echo; gpg --list-sigs "John Doe" && gpg --armor --export "John Doe") >> KEYS svn diff KEYS svn commit KEYS -m "Add key for John Doe"
Repeat with https://dist.apache.org/repos/dist/release/datafusion for the release file.
Start from the latest main in the apache remote:
git fetch apache git checkout -b release-56.0.0 apache/main
Set version under [workspace.package] in the root Cargo.toml to the release version (for example 56.0.0).
Replace any DataFusion git dependencies in [workspace.dependencies] with the released versions from crates.io (for example datafusion = { version = "56.0.0", default-features = false }), and make sure the arrow version matches the one DataFusion uses.
Run cargo update -p datafusion (and the other changed crates) so that Cargo.lock is updated, then run the checks from AGENTS.md:
cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings cargo test -p datafusion-spark cargo test -p datafusion-spark-sqllogictest cargo publish --dry-run -p datafusion-spark
The changelog lists the PRs merged since the previous release. PRs are categorized by their GitHub labels and their Conventional Commits title prefix (feat:, fix:, docs:, perf:, and ! for breaking changes), so it is worth fixing up mislabelled PR titles before generating it.
Pass the previous release tag, the ref to release, and the new version:
export GITHUB_TOKEN=<your-token> mkdir -p dev/changelog python3 dev/release/generate-changelog.py v55.0.0 HEAD 56.0.0 > dev/changelog/56.0.0.md
For the first release, use the first commit of the repository as the previous ref (git rev-list --max-parents=0 HEAD).
Review the generated file, then commit everything and open a PR against main:
git commit -a -m "chore: prepare 56.0.0 release" git push <your-fork> release-56.0.0
After the release PR is merged, create the release candidate artifacts from the merged commit.
RC numbers start at 1 for each version and increase by one for every new candidate.
The official release artifact is the signed tarball, but we also tag the commit for convenience and code archaeology:
git fetch apache git tag v56.0.0-rc1 apache/main git push apache v56.0.0-rc1
./dev/release/create-tarball.sh 56.0.0 1
The script:
Cargo.toml has the release version.dev/dist/apache-datafusion-spark-56.0.0-rc1/apache-datafusion-spark-56.0.0.tar.gz from the tagged commit with git archive..sha256 and .sha512 checksums.dev/dist is ignored by git and can be removed after the upload.
Send the email printed by create-tarball.sh to dev@datafusion.apache.org. The vote stays open for at least 72 hours, and the release needs at least three binding +1 votes from PMC members and more binding +1 than -1 votes.
When the vote ends, reply with a [RESULT] [VOTE] Release Apache DataFusion Spark 56.0.0 RC1 email that tallies the votes.
Anyone can help verify a release candidate. The verify-release-candidate.sh script downloads the RC, checks its signature and checksums, installs a Rust toolchain in a temporary directory, and then checks formatting, runs the tests, and runs cargo publish --dry-run:
./dev/release/verify-release-candidate.sh 56.0.0 1
Set VERIFY_TMPDIR to keep the working directory after the script finishes.
Beyond the script, check that the LICENSE.txt and NOTICE.txt files are present and correct and that the tarball does not contain any compiled code.
Fix the problems found during the vote, merge the fixes into main, and start again from Create the Release Candidate with the next RC number.
These steps can only be done by PMC members.
./dev/release/release-tarball.sh 56.0.0 1
This copies the approved RC to https://dist.apache.org/repos/dist/release/datafusion/datafusion-spark-56.0.0.
Point the release tag at the approved RC tag:
git tag v56.0.0 v56.0.0-rc1 git push apache v56.0.0
The release is now official.
Only approved release tarballs may be published to crates.io, to comply with Apache Software Foundation governance.
If you have not published the crate before, follow the cargo publishing instructions to create an account and log in to crates.io, then ask an existing owner to add you to the datafusion-spark crate.
Download and unpack the official release tarball, check that the root Cargo.toml has the release version, and publish from inside it:
curl -O https://dist.apache.org/repos/dist/release/datafusion/datafusion-spark-56.0.0/apache-datafusion-spark-56.0.0.tar.gz tar xzf apache-datafusion-spark-56.0.0.tar.gz cd apache-datafusion-spark-56.0.0 cargo publish -p datafusion-spark
datafusion-spark-sqllogictest has publish = false and is not published.
Remove the release candidates from the dev area:
svn delete -m "Remove Apache DataFusion Spark 56.0.0 release candidates" \ https://dist.apache.org/repos/dist/dev/datafusion/apache-datafusion-spark-56.0.0-rc1
Only the latest release of each project should stay in the release area. Older releases are archived automatically at https://archive.apache.org/dist/datafusion/, so remove the previous one:
svn delete -m "Remove Apache DataFusion Spark 55.0.0" \ https://dist.apache.org/repos/dist/release/datafusion/datafusion-spark-55.0.0
v56.0.0 tag, linking to the changelog.[ANNOUNCE] Apache DataFusion Spark 56.0.0 released email to dev@datafusion.apache.org and announce@apache.org (from your apache.org address).