Skip to content

refactor: stop using DataFusion APIs deprecated or changed in DataFusion 55 - #9640

Merged
wjones127 merged 1 commit into
lance-format:mainfrom
slachiewicz:agent/datafusion-55-prep
Oct 5, 2026
Merged

wjones127 merged 1 commit into
lance-format:mainfrom
slachiewicz:agent/datafusion-55-prep

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Replace DataFusion APIs that are deprecated on the DataFusion 54 in main, or that DataFusion 55 changes, with spellings that work on both. No behaviour change.

  • UnionExec::try_new instead of UnionExec::new (deprecated since DataFusion 44) in the MemWAL full-text, vector and planner scans, dropping their #[allow(deprecated)]. try_new returns a single input unchanged, so the one-plan branches in fts_search.rs are removed. It only rejects inputs with a different field count, so the cross-column schema check stays; its comments now say that rather than describing a panic in UnionExec::new.
  • LoweredAggregateBuilder instead of create_aggregate_expr_and_maybe_filter (deprecated in DataFusion 54) in Scanner::build_physical_aggregate_expr and the count_from_mask test helper, resolving the TODO(datafusion-54) notes. The aggregate is named and displayed exactly as the deprecated function did, so plans and output column names are unchanged.
  • Partitioning::partition_count() instead of an exhaustive match in merge-insert, and datafusion::common::TableReference instead of the datafusion::sql re-export. DataFusion 55 adds Partitioning::Range and drops that re-export, so both call sites would otherwise break on upgrade.

Part of the Arrow 59 / DataFusion 55 groundwork with #8997. The full upgrade is kept on slachiewicz/lance@agent/datafusion-55-upgrade until geodatafusion and datafusion-python ship DataFusion 55 releases.

Overlap with open PRs: draft #8572 removes build_physical_aggregate_expr, so whichever lands second drops or adapts that hunk; #9174 carries the same UnionExec::new block in fts_search.rs.

Ran cargo fmt --all, cargo clippy --all --tests --benches -- -D warnings, cargo test -p lance --lib -- mem_wal::scanner count_from_mask aggregate (242 passed) and cargo test -p lance --test integration_tests -- count_pushdown (3 passed).

Part of #9647.

🤖 Generated with Claude Code

…ion 55

Replace UnionExec::new, deprecated since DataFusion 44, with
UnionExec::try_new in the MemWAL scanners and drop the #[allow(deprecated)]
markers. try_new returns a single input unchanged, so the one-plan branches
in the full-text search planner go away. It only rejects inputs with
different field counts, so the cross-column schema check stays; its comments
now say so instead of describing a panic in UnionExec::new.

Build physical aggregates with LoweredAggregateBuilder instead of the
deprecated create_aggregate_expr_and_maybe_filter, naming and displaying them
exactly as that function did so plans and output columns are unchanged.

Read the merge-insert partition count through Partitioning::partition_count
and import TableReference from datafusion::common. DataFusion 55 adds a
Partitioning::Range variant and drops the datafusion::sql re-export, so these
call sites keep compiling after the upgrade.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

No merge-blocking issues found. All 274 focused local tests passed, covering MemWAL scans and search, count execution, aggregate aliases and ordering, and multiple fragments.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 1, 2026
@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. and removed K-approved Latest Gatekeeper recommendation permits acceptance. labels Oct 1, 2026
zhangyue19921010 pushed a commit that referenced this pull request Oct 2, 2026
…ld (#9645)

`a_renamed_field_inside_a_map_resolves_by_id` in
`rust/lance/src/dataset/mem_wal/reconcile.rs` builds a `MapArray` whose
key field comes from the test's `stamped()` helper, which always returns
a nullable field. The Arrow format requires map keys to be non-nullable;
arrow 58 accepts the array anyway, but arrow 59 rejects it in
`MapArray::try_new` with `MapArray keys field cannot be nullable`, so
the test panics after the upgrade.

Mark the key field non-nullable in both places the test builds it (2
lines, test-only). The test still checks the same rename-by-id behaviour
and passes on today's arrow 58.

Groundwork for the Arrow 59 / DataFusion 55 upgrade alongside #8997,
#9640, #9641 and #9643.

Ran `cargo fmt --all`, `cargo clippy -p lance --tests -- -D warnings`,
and `cargo test -p lance --lib -- dataset::mem_wal::reconcile` (11
passed).

Part of #9647.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
@wjones127
wjones127 self-requested a review October 2, 2026 13:15
wjones127 pushed a commit that referenced this pull request Oct 2, 2026
Groundwork for the Arrow 59 / DataFusion 55 / pyo3 0.29 upgrade, limited
to what compiles against the Arrow 58 / DataFusion 54 on `main`, so the
upgrade itself shrinks to version bumps plus API migrations that only
exist in the new releases.

- **MSRV 1.91 → 1.94** in the three `Cargo.toml` files and the `msrv` CI
matrix. DataFusion 55.x declares `rust-version = 1.94.0`; the pinned
toolchain is already 1.98.1.
- **`FixedSizeBinaryArray` construction in tests and a doc example**
goes through `try_from_iter`, which both Arrow 58 and 59 provide. Arrow
59 removes the infallible `From<Vec<&[u8]>>` /
`From<Vec<Option<&[u8]>>>` impls; `try_from(..).unwrap()` would carry
over, but on Arrow 58 it trips
`clippy::unnecessary_fallible_conversions`.
- **`record_batch!`** is imported from `arrow_array` instead of the
`datafusion::common` re-export in `lance-namespace-datafusion`.

Related groundwork, also mergeable on `main` today:
- #9640 stops using DataFusion APIs that are deprecated or changed in
DataFusion 55 (`UnionExec::try_new`, `LoweredAggregateBuilder`,
`Partitioning::partition_count`, `TableReference` path).
- #9641 rejects a zero `batch_size` in `LanceExecutionOptions` (today it
panics inside DataFusion; DataFusion 55 makes the setting non-zero).
- #9643 drops a struct-concat workaround in the `lance-encoding` test
helper that waited for arrow 56, removing one of the
`MutableArrayData::extend` calls arrow 59 deprecates.
- #9645 makes a MemWAL test build its map with a non-nullable key, which
arrow 59 now requires (`MapArray keys field cannot be nullable`).

Not in this PR: the dependency bumps and lockfiles,
`MutableArrayData::try_extend` (new in Arrow 59), and the DataFusion 55
`ExecutionPlan` migration (`apply_expressions`, `replace_children`,
`statistics_from_inputs`, `input_distribution_requirements`,
`PhysicalPlanningContext`, `EnsureRequirements`, `ConfigNonZeroUsize`)
plus `PyCapsule::new_with_value` for pyo3 0.29. The complete upgrade is
kept rebased on
[`slachiewicz/lance@agent/datafusion-55-upgrade`](https://github.com/slachiewicz/lance/tree/agent/datafusion-55-upgrade).
It builds and passes `clippy -D warnings` (workspace and Python
bindings) against a temporary patch, and waits for:
- a geodatafusion release for DataFusion 55
(datafusion-contrib/geodatafusion#105) — geoarrow 0.9 with Arrow 59 is
already released, so `geo` stays a default feature;
- datafusion-python 55 on PyPI (apache/datafusion-python#1696).

Part of #9647.

*This change was created with AI assistance.*
@wjones127
wjones127 merged commit eff937f into lance-format:main Oct 5, 2026
11 checks passed
ruslan-shaydullin added a commit to ruslan-shaydullin/lance that referenced this pull request Oct 6, 2026
Merge upstream main after the combined_fields flat scoring change
(lance-format#9444) and the DataFusion 55 cleanup (lance-format#9640). Only the four import
lists conflicted; they now carry both sides, and the restricted Match
patch itself is unchanged.

Signed-off-by: Ruslan Shaydullin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants