Skip to content

Upgrade lancedb to 0.42.0-beta.21 - #78

Merged
Xuanwo merged 2 commits into
mainfrom
xuanwo/upgrade-lancedb-bindings
Nov 21, 2026
Merged

Xuanwo merged 2 commits into
mainfrom
xuanwo/upgrade-lancedb-bindings

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Upgrade the pinned LanceDB SDK from 0.33.0 to v0.42.0-beta.21 and fix the bindings forward without changing the C header or ABI.

  • lancedb v0.42.0-beta.21 (git tag; 0.42.0 is not published to crates.io)
  • lance/lance-io/lance-namespace v15.0.0-beta.25 (same git tag and source URL as the upstream lancedb workspace, so only one lance crate is linked)
  • arrow 59 (59.3.3 resolved), datafusion 55 (55.3.0 resolved)
  • lancedb_connection_list_namespaces drains the SDK's paged Listing, preserving the previous "return every namespace under the parent" behavior
  • SDK variants added after 0.33 that have no dedicated C code, including missing-column, schema, job and SQL errors, fall back to LANCEDB_OTHER through the existing wildcard mapping; the error-code surface is unchanged
  • valgrind suppression for Lance 15's process-lifetime BLOB_V2_DESC_* LazyLock schema globals

The binding/package version is unchanged in this PR: version selection and manifest/package alignment belong to the pre-1.0 SemVer work in the release task.

Minimum supported Rust version

Cargo.toml now declares rust-version = "1.95.0" and the README records the same minimum. This is the highest rust-version in the locked graph for every supported target: x86_64/aarch64 Linux, x86_64/aarch64 macOS and x86_64 Windows GNU. lancedb 0.42 and Lance 15 declare 1.95.0; DataFusion 55.3 declares 1.94.0. Hosted CI builds with current stable, so this PR does not claim that a 1.95 Rust build was exercised.

Migration notes

Reusable for the first preview release notes.

SQL predicates: string literals use single quotes

LanceDB 0.42 applies SQL-standard quoting to predicates: double quotes delimit identifiers, single quotes delimit string literals.

Before (0.33, no longer valid): key = "key_42" now parses key_42 as an identifier.
After: key = 'key_42'.

Double-quoted identifiers still work and are useful for non-lowercase or reserved column names, e.g. "key" = 'key_42' or "Column Name" = 'value'.

Impact: callers that used double quotes for string values now get a schema error such as No field named key_42. Replace those literals with single quotes. C tests and the full example are updated accordingly.

IVF probe defaults are adaptive; fixed 20 is still available

LanceDB 0.42 leaves the IVF probe bounds unset by default and uses Lance's adaptive probe selection (SDK #4168). 0.33 used a fixed minimum/maximum of 20/20.

Call lancedb_vector_query_nprobes(query, 20, ...) to request the previous fixed behavior; a positive value sets both bounds while search effort is unset. The C API does not expose search_effort, minimum_nprobes or maximum_nprobes, so adaptive selection is the only unconfigured mode.

nprobes(0) fails at execute/explain, not in the setter

lancedb_vector_query_nprobes() still returns LANCEDB_SUCCESS and stores the value, matching the existing setter timing. Validation happens when the SDK builds the query:

  • lancedb_vector_query_execute() returns NULL.
  • lancedb_vector_query_explain_plan() returns LANCEDB_INVALID_INPUT with the message nprobes must be greater than 0.

Callers that accept untrusted values should validate them before executing.

Vector index on an initially empty table succeeds

lancedb_table_create_vector_index on a table with no rows now returns LANCEDB_SUCCESS and creates a listed index. Before 0.42 it failed with an error.

Callers that used that failure to detect an empty table must check lancedb_table_count_rows themselves.

Enterprise (db://) connections reject a custom session

Attaching a session with lancedb_connect_builder_session() and executing a db:// connection now returns LANCEDB_NOT_SUPPORTED with session is not supported for LanceDB Enterprise connections (SDK #4486). Embedded connections are unchanged. Enterprise callers must omit the custom session and use server-managed caching.

Validation

Host: Amazon Linux 2023, Arrow C++ 26.0.1, Rust 1.98.1.

  • cmake -S . -B build -G Ninja -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release and ninja -C build -j8
  • ninja -C build check (cargo fmt --check, cargo clippy)
  • Focused regressions: double-quoted identifiers, nprobes(0) at execute/explain, empty-table and missing-column vector index paths, db:// custom-session rejection
  • ctest --test-dir build -j4 --output-on-failure: 9/9 passed, including the 7 valgrind suites
  • examples/simple and examples/full run to completion; full covers SQL filters, delete predicates, index and merge-insert paths

Valgrind: before the suppression, 5 suites failed only on possibly-lost records whose stacks start in Lance's BLOB_V2_DESC_FIELD / BLOB_V2_DESC_LANCE_FIELD LazyLock initializers; 0 bytes were definitely lost. The suppression matches only match-leak-kinds: possible stacks containing BLOB_V2_DESC, and the suites pass with the rest of the existing suppression config active.

Hosted CI is running on this head.

* lance 15.0.0-beta.25, arrow 59, datafusion 55
* keep the C API unchanged and follow the SDK's SQL predicate quoting and
  empty-table index semantics
* collect every namespace page in list_namespaces
* suppress Lance blob v2 process-lifetime global schema allocations

Signed-off-by: Xuanwo <[email protected]>
* derive the minimum from the locked graph for every supported target
* document adaptive IVF probes, nprobes(0) validation and db:// session
  rejection
* add focused C regressions for the three observable behaviors
* fold new error variants into the existing LANCEDB_OTHER fallback so the
  coverage gate does not drop on unreachable mappings

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant