chore: prepare 56.1.0 release (#438) ## Which issue does this PR close? - None. This prepares the 56.1.0 release, the first release of `datafusion-spark` from this repository. ## Rationale for this change Up to 56.0.0, `datafusion-spark` was released as part of Apache DataFusion, from `branch-56` of apache/datafusion. Since then, new Spark-compatible functions and fixes have landed here. Under the versioning policy in `dev/release/README.md`, new functions on DataFusion 56 make this a minor release: 56.1.0. ## What changes are included in this PR? - `Cargo.toml`: the workspace version goes from 56.0.0 to 56.1.0. All four crates inherit it. Only `datafusion-spark` is published. - `Cargo.lock`: updated by `cargo update --workspace`. Only the workspace crate versions change. `datafusion-cli` and `datafusion-sqllogictest` still pull in `datafusion-spark` 56.0.0 from crates.io as before. - `dev/changelog/56.1.0.md`: generated with `dev/release/generate-changelog.py ef4c88a a9fdcae 56.1.0`. `ef4c88a` is the last commit imported from apache/datafusion (confirmed with @andygrove), so the changelog covers the 95 commits made in this repository. On top of the generated file, I: - added a short note that this is the first release from this repository - moved three PRs that had no `feat:`/`fix:` title prefix out of "Other": #86 (`to_json`) to enhancements, and #66 and #351 to bug fixes There are no DataFusion git dependencies, and DataFusion 56.0.0 comes from crates.io. ## Are these changes tested? 1. Local unit tests 2. Dry run cargo build ## Are there any user-facing changes? No code changes. After this merges, I will create the `v56.1.0-rc1` tag on the merge commit and start the vote on dev@datafusion.apache.org.
Apache DataFusion expressions that emulate Apache Spark's behavior.
This crate provides Spark-compatible scalar, aggregate, and table functions that can be registered with a DataFusion SessionContext.
[dependencies] datafusion = "56" datafusion-spark = { version = "56", features = ["core"] }
The core feature provides the session helper and registers the Spark functions. Add sql as well to enable the Spark planner rewrites, which is what gives operators such as / their Spark semantics (both sides cast to DOUBLE, and a zero divisor returns NULL):
datafusion-spark = { version = "56", features = ["core", "sql"] }
Call with_spark_features after with_default_features, since Spark functions replace DataFusion functions with the same name:
use datafusion::execution::SessionStateBuilder; use datafusion::prelude::SessionContext; use datafusion_spark::SessionStateBuilderSpark; let state = SessionStateBuilder::new() .with_default_features() .with_spark_features() .build(); let ctx = SessionContext::new_with_state(state); // `sha2` now has Spark semantics let df = ctx.sql("SELECT sha2('Spark', 256)").await?;
See the function reference for the documented functions, the crate README and the API documentation for more.
crates/spark – the datafusion-spark cratecrates/sqllogictest – SQL logic tests for the Spark functionscrates/cli – datafusion-spark-cli, a SQL shell with the Spark functions registered (cargo run -p datafusion-spark-cli).ai/skills – agent skills for working on this repository (see AGENTS.md)cargo build
cargo test
Contributions are welcome. See CONTRIBUTING.md for implementation and testing guidelines. Before opening a PR, run:
cargo fmt --all cargo clippy --all-targets --all-features -- -D warnings cargo test -p datafusion-spark cargo test -p datafusion-spark-sqllogictest
Licensed under the Apache License, Version 2.0.