Repository navigation
chore: upgrade DataFusion to 55 and Arrow to 59 - #10397
Merged
Merged
Conversation
Bump DataFusion 54 -> 55 and Arrow 58 -> 59.2 across the Rust workspace, the Python bindings and the Java JNI crate, along with the dependencies that must move in lockstep: geodatafusion 0.6, geoarrow 0.9, pyo3 0.29 and pythonize 0.29. The Python `datafusion` requirement moves to `>=55,<56` so the datafusion-python major version matches the datafusion-ffi version pylance is built against. Migration for DataFusion 55 breaking changes: - Implement the now-required `ExecutionPlan::apply_expressions`. Nodes that own physical expressions (FilteredReadExec, LanceFilterExec, CountFromMaskExec and the memtable scan nodes) report them. - Migrate statistics from the deprecated `partition_statistics` to `child_stats_requests` + `statistics_from_inputs`, and compute stats through `StatisticsContext` in callers and tests. - Replace deprecated `with_new_children` calls with `replace_children_if_necessary` (or `replace_children` in tests that deliberately rebuild a node). - Pass a `PhysicalPlanningContext` to `create_physical_expr` and `LoweredAggregateBuilder`, and update `ExtensionPlanner::plan_extension`. - Build `AnalyzeExec` through its builder. - `EnforceDistribution` was removed; use `EnsureRequirements`. - The execution batch size is now a `ConfigNonZeroUsize`, so a zero `LanceExecutionOptions::batch_size` is rejected with an invalid-input error instead of panicking inside DataFusion. Arrow 59 / pyo3 0.29 follow-ups: `MutableArrayData::try_extend` and `PyCapsule::new_with_value`. The arrow-scalar and arrow-stats crate versions track the Arrow major version. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Follow-up to the DataFusion 55 / Arrow 59 upgrade, fixing the test regressions it introduced. - Keep distribution-only physical optimization. DataFusion 55 folded `EnforceDistribution` into `EnsureRequirements`, which also enforces sort requirements and drops sorts that no parent declares it needs. Many Lance nodes (e.g. `TakeExec`) do not declare whether they maintain input order, so that rule removed the score sort under full-text search results. Rebuild the old rule from DataFusion's public pieces until those nodes declare their ordering (#9647). - Build `project()` with the requested schema's metadata. DataFusion 55's `UnionExec` relabels any input whose schema metadata differs from the union's, which added a no-op projection over scalar-index union arms. - Treat `-0.0` and `+0.0` as the same merge-insert key. DataFusion 55's hash join now matches float keys per IEEE 754, so the indexed lookup probes both zero encodings to agree with it (and with Lance filters). - Copy rows of maps whose entries break the Arrow spec without validation. Arrow 59's `take` rebuilds maps through the validating `MapArray::try_new`, which rejected exactly the maps the blank-row `Take` fallback exists for. - Build the relabelling cast explicitly in the MemWAL index filter test, since DataFusion 55 no longer casts a column whose nested field metadata differs from a list literal's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Resolve conflicts with main and port its new code to DataFusion 55 and Arrow 59: MergeConditionExec now takes a `&dyn Session` and reports its conditions via apply_expressions, OrderedConcatExec gains apply_expressions, the row-offset statistics fix moves into statistics_from_inputs, and planar sparse pages use try_extend. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
-0.0 and +0.0 are one key now, so a source holding both matches each zero target row twice: Fail rejects it as ambiguous, FirstSeen updates each once. Also note in compact_blank_source why its validating take is safe.
Hide the signed_zero module from docs since it is public only for internal reuse, and keep the with_new_children doc comment on TakeExec::with_new_children. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
DataFusion 55 normalizes -0.0 and +0.0 before equality comparisons. BTree lookup used Arrow's total-order comparison for page selection and key grouping, so it could miss a page or return only one zero encoding.\n\nUse the same zero normalization for float page bounds and before hashing lookup keys and page values. Add a two-page regression test.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Btree lookup now applies signed-zero equality consistently to page selection and row matching, including zeros split across pages.
Keeping distribution-only optimization preserves the existing full-text-search ordering. Adopting EnsureRequirements can follow the ordering audit discussed in #9647.
BubbleCal
approved these changes
Oct 28, 2026
Xuanwo
added a commit
that referenced
this pull request
Nov 23, 2026
…arrow (#11294) cc @westonpace — opening this PR to consolidate `lance-arrow-scalar` and `lance-arrow-stats` into `lance-arrow` ahead of the `v15.0.0` release. Happy to hear your thoughts if you still want to keep them as standalone Arrow-versioned crates! ## Context While preparing the `v15.0.0` stable release, we hit a hard Rust publish blocker: 1. **Blocked `v15.0.0` crates.io publish**: `#10397` bumped `lance-arrow-scalar` and `lance-arrow-stats` to `59.0.0` (pinned via `=59.0.0` in the root `Cargo.toml`), while crates.io still only has `58.0.0`. `.github/workflows/cargo-publish.yml` excludes both crates (`--exclude lance-arrow-stats --exclude lance-arrow-scalar`), and there is no other publish workflow, so `cargo publish --workspace` fails immediately when resolving `lance-index`. 2. **Silent source drift on crates.io**: Because these two crates track Arrow's major version instead of `workspace.package.version` and were excluded after `#6972`, changes in `#6808` (`ArrowScalar::is_nan`) and `#7966` (`Decimal128/Decimal256` min/max stats) landed without bumping `58.0.0`. Rust users installing `lance 8.x–14.0.3` from crates.io received the stale May `58.0.0` tarball instead of the workspace source, and `#10102` added further Lance-specific ZoneMap seed NaN tracking on top. 3. **Zero external usage & single-owner publishing**: On crates.io, both crates have only internal Lance reverse dependencies (`lance-arrow-stats`, `lance-index`, `lance`) and a single crate owner (missing `github:lancedb:release`). 4. **Original goal still holds in `lance-arrow`**: The original motivation in `#5955` / `#5967` was to avoid pulling DataFusion into lower-level crates. `lance-arrow` has zero DataFusion dependencies, is already depended on by `lance-encoding`, `lance-file`, `lance-core`, and `lance-index`, and follows `workspace.package.version` cleanly. Since `v15.0.0` is already a breaking major (Arrow 59 / DataFusion 55) and crates.io SemVer prevents downgrading `59.0.0` back to `15.0.0` under the old crate names, merging them into `lance-arrow` removes the dual-track versioning and publish exclusions cleanly. ## Changes - Move `ArrowScalar` (and its `From` conversions) into `lance_arrow::scalar::ArrowScalar` (`rust/lance-arrow/src/scalar/`). - Drop the unused custom binary scalar codec (`rust/arrow-scalar/src/serde.rs`, 558 lines with zero callers outside its own unit tests). - Move `StatisticsAccumulator`, `Statistics`, `NanCounts`, `count_nans`, and `count_nans_signed` into `lance_arrow::stats` (`rust/lance-arrow/src/stats.rs` and `rust/lance-arrow/src/stats/nan.rs`), along with its proptest regression seeds (`rust/lance-arrow/proptest-regressions/stats.txt`). - Add `arrow-cast` and `arrow-row` to `rust/lance-arrow/Cargo.toml` (both are already workspace Arrow dependencies; `lance-arrow` remains free of DataFusion). - Update internal callers (`lance-index` zonemap/bloomfilter and `rust/lance/tests/arrow_ordering.rs`) and remove `rust/arrow-scalar` and `rust/arrow-stats` from the workspace and all three lockfiles (`Cargo.lock`, `python/Cargo.lock`, `java/lance-jni/Cargo.lock`). - Drop `--exclude lance-arrow-stats --exclude lance-arrow-scalar` from `.github/workflows/cargo-publish.yml`, and update the `arrow-ordering-compat` path trigger in `.github/workflows/rust.yml` and `rust/AGENTS.md`. ## Notes on `arrow-ordering-compat` No ordering expectations in `rust/lance/tests/arrow_ordering.rs` changed—only the two `use` imports were updated from `lance_arrow_scalar` / `lance_arrow_stats` to `lance_arrow::scalar` / `lance_arrow::stats`. Because the base branch's copy of `arrow_ordering.rs` still references the removed crates, the base-branch compile check in `arrow-ordering-compat` will need the `arrow-ordering-reviewed` label once reviewed. ## Verification - `cargo fmt --all -- --check` - `cargo test --profile ci --locked -p lance-arrow` (366 passed, including 34 `scalar::arrow_scalar`, 4 `scalar::convert`, 64 `stats::`, and 9 doctests) - `cargo test --profile ci --locked -p lance-index --lib 'scalar::zonemap::tests'` (85 passed) and `'scalar::bloomfilter::tests'` (36 passed) - `cargo test --profile ci --locked -p lance --test arrow_ordering` (46 passed) - `RUSTDOCFLAGS="-D warnings" cargo doc --profile ci --locked --no-deps -p lance-arrow` - `cargo clippy --profile ci --locked --all --tests --benches -- -D warnings` - `cargo clippy --profile ci --locked -p lance --test arrow_ordering -- -D warnings` - `cargo package --workspace --no-verify --all-features` and `cargo publish --workspace --all-features --dry-run --no-verify` (all 28 workspace crates resolve and pass dry-run) - `cargo metadata --frozen` verified across `Cargo.toml`, `python/Cargo.toml`, and `java/lance-jni/Cargo.toml`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9647.
DataFusion 55 and Arrow 59 require a coordinated upgrade across the Rust workspace, Python bindings, and Java JNI crate. This PR carries the original implementation forward, resolves its conflicts with the current
main, and adapts the remaining execution-plan, spill, and binding APIs to DataFusion 55.This replaces #9979 because that branch is owned by an organization where the maintainer cannot push. The original commit authors are preserved in the branch history; the trailers at the end of this description also retain their credit if the PR is squash-merged.
Behavior changes
AnalyzeExecconstruction to DataFusion 55.EnforceDistributionremoval, align indexed and hash-join signed-zero matching, and keep Arrow 59 map copying behavior compatible with existing data.SpillFileAPI and refresh the Rust, Python, Java, and Python dependency lockfiles.59.0.0versions are not yet on crates.io.Verification
cargo fmt --all -- --checkcargo clippy --all --tests --benches -- -D warningscargo check --workspace --tests --benches, including--all-featurescargo package --workspace --no-verify --all-featuresmake install,uv run make lint, andtest_table_provider.py./mvnw testThanks to @timsaucer for the original implementation and careful behavior analysis, and to @slachiewicz, @wjones127 for the review, signed-zero discussion, and follow-up coverage. Their contributions and review history made this upgrade possible.
Co-authored-by: Sylwester Lachiewicz [email protected]
Co-authored-by: Tim Saucer [email protected]