chore(deps): bump DataFusion to 56.0.0 (#120) ## Which issue does this PR close? N/A — upgrades the binding to DataFusion 56.0.0. ## Rationale for this change DataFusion 56.0.0 has been released. This was first tested against `56.0.0-rc2` during the vote, and now points at the published crates. ## What changes are included in this PR? - `datafusion`, `datafusion-proto`, `datafusion-spark` and `datafusion-substrait` move from 55.0.0 to 56.0.0. `arrow` moves from 59 to 60 and `object_store` from 0.13 to 0.14, matching what DataFusion 56 pulls in. - `<datafusion.version>` is set to `56.0.0`, so the `.proto` files are downloaded from the release tag. Both `<sha512>` digests are updated. Changes needed for the upstream API changes: - **`TableProvider::scan` takes `Option<&[usize]>`** for the projection, not `Option<&Vec<usize>>`. `JavaTableProvider` is updated to match. - **`ParquetOptions.compression` is now `Option<DFParquetCompression>`**, not a `String`. `writeParquet` parses the caller's string with `DFParquetCompression::from_str`. A side effect: an invalid codec or level is now rejected before writing starts, with a `Configuration` error, instead of failing when the first file is written. - **`ArrowArrayStreamReader` was renamed to `RecordBatchStreamReader`** in arrow 60. The old name is a deprecated alias, and it would fail `clippy -D warnings`. ## Are these changes tested? Covered by the existing suites: - `./mvnw test`: 349 tests, 0 failures, 13 skipped (TPC-H data-gated tests; no local TPC-H data). - `cargo test --workspace --features substrait,spark`: passing. - `cargo clippy --all-targets --workspace --features substrait,spark -- -D warnings`: clean. - `cargo fmt --all` and `./mvnw spotless:apply`: clean. ## Are there any user-facing changes? An invalid Parquet compression string passed to `writeParquet` now fails earlier, at configuration time. Otherwise there are no API changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Java bindings for Apache DataFusion. Queries run in native Rust and results return to the JVM as Apache Arrow batches via the Arrow C Data Interface.
Early development: the API will change between releases. Bug reports and contributions welcome.
Released to Maven Central. The JAR bundles the native library for Linux and macOS on x86_64 and aarch64. Windows users need to build from source.
Maven:
<dependency> <groupId>org.apache.datafusion</groupId> <artifactId>datafusion-java</artifactId> <version>0.1.0</version> </dependency>
Gradle:
implementation("org.apache.datafusion:datafusion-java:0.1.0")
Arrow needs --add-opens=java.base/java.nio=ALL-UNNAMED on the JVM command line. See the installation guide for details and for building from source.
import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.ipc.ArrowReader; import org.apache.datafusion.DataFrame; import org.apache.datafusion.SessionContext; try (var allocator = new RootAllocator(); var ctx = new SessionContext()) { ctx.registerParquet("orders", "/path/to/orders.parquet"); try (DataFrame df = ctx.sql( "SELECT o_orderpriority, COUNT(*) AS n " + "FROM orders GROUP BY o_orderpriority"); ArrowReader reader = df.collect(allocator)) { while (reader.loadNextBatch()) { var batch = reader.getVectorSchemaRoot(); // ... } } }
SessionContext and DataFrame are AutoCloseable and not thread-safe.
The full documentation lives under docs/source/ and is built with Sphinx (see docs/README.md for the build steps):
JDK 17+. Building from source: see docs/source/contributor-guide/development.md.
Open an issue to discuss non-trivial changes before sending a PR. See the contributor guide.
Apache License 2.0. See LICENSE.txt and NOTICE.txt.