Skip to content

build: bump lance.version to 12.0.0-rc.1 - #828

Open
hamersaw wants to merge 3 commits into
lance-format:mainfrom
hamersaw:bump-lance-12.0.0-rc.1
Open

hamersaw wants to merge 3 commits into
lance-format:mainfrom
hamersaw:bump-lance-12.0.0-rc.1

Conversation

@hamersaw

@hamersaw hamersaw commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bumps lance.version from 11.0.0-beta.21 to 12.0.0-rc.1 and adapts the connector to the API and behaviour changes that come with it.

lance-core 12 declares lance-namespace 0.11.1 and bundles namespace implementations compiled against it, so lance-namespace.version has to move from 0.8.6 to 0.11.1 at the same time — leaving the pin at 0.8.6 fails to resolve org.lance.namespace.model classes.

API changes

Change Reason
queryTable(...).getData() LanceNamespace.queryTable now returns QueryTableResponse rather than byte[]
Namespace test doubles namespaceExists/tableExists return response objects rather than void
RewriteRows update mode in both SparkPositionDeltaWrite copies Update operations must set updateMode explicitly — the transaction format cannot persist an absent mode distinctly from RewriteRows, so this preserves what absence previously implied
Widened storage version assertions STABLE now resolves to file version 2.2
Null-struct test asserts failure File version 2.0 now rejects null structs instead of silently reading them back as non-null structs with null children

The updateMode change alone accounts for 58 of the 70 test failures the bump initially caused.

Blob v2

Lance 12 resolves both the default and stable file format versions to 2.2, and 2.2 rejects the legacy lance-encoding:blob encoding outright.

BlobUtils.fileFormatSupportsBlobV2 treated an unset version and named aliases as unable to store blob v2, so those tables were written with legacy blob metadata and then failed at creation. It now treats unset and stable as blob v2 capable, matching what Lance resolves them to. An explicit version below 2.2 still selects the legacy encoding, which remains valid there, and legacy maps to 0.1 and still returns false.

This changes the default blob encoding for tables created without an explicit file_format_version: they now get blob v2 and read back as descriptor structs rather than raw BINARY. Tables that need the v1 encoding must pin a version below 2.2. docs/src/config.md is updated to match.

The blob v1 suites created their tables without a version, so they now pin 2.1 to go on exercising the v1 path, including the __blob_size and __blob_pos virtual columns that blob v2 replaces with descriptor struct fields.

Test status

./mvnw test -pl lance-spark-3.5_2.13 -am1397 tests, 0 failures, 0 errors.

The same classes are green on 11.0.0-beta.21, and lance-spark-3.4_2.12, lance-spark-4.0_2.13 and lance-spark-4.2_2.13 all test-compile.

Why this is still a draft

org.lance:lance-core:12.0.0-rc.1 is not published to Maven Central. The v12.0.0-rc.1 Java publish workflow has not completed — the tag is several hours old and Central's newest lance-core is still 12.0.0-beta.18. CI cannot resolve the dependency until that lands, and it may be worth checking whether that release job is stuck.

Everything above was therefore verified against 12.0.0-beta.18, which shares the v12 API surface. The pin needs re-verifying against the real rc.1 artifact once it publishes.

🤖 Generated with Claude Code

https://claude.ai/code/session_017acNiGMFxRXWVGnpkFFdhK

lance-core 12 declares lance-namespace 0.11.1, so lance-namespace.version
moves from 0.8.6 to 0.11.1 alongside it. lance-core bundles namespace
implementations compiled against 0.11.1, and leaving the pin at 0.8.6
fails to resolve org.lance.namespace.model classes.

Adapt to the API changes this pulls in:

- LanceNamespace.queryTable now returns QueryTableResponse rather than
  byte[]; unwrap with getData() in LanceSearchColumnarPartitionReader.
- namespaceExists/tableExists return response objects rather than void;
  update the namespace test doubles accordingly.
- Update operations must set updateMode explicitly, since the
  transaction format cannot persist an absent mode distinctly from
  RewriteRows. Both SparkPositionDeltaWrite copies now pass RewriteRows,
  matching the behaviour absence previously implied.
- STABLE now resolves to file version 2.2, so widen the storage version
  assertions.
- File version 2.0 rejects null structs instead of silently reading them
  back as non-null structs with null children, so assert the failure.

Verified against 12.0.0-beta.18, as 12.0.0-rc.1 is not yet published to
Maven Central. Nine BlobCreateTableTest/BlobJoinTest/BlobV2CopyTest cases
still fail: file version 2.2 drops the legacy "lance-encoding:blob"
encoding and requires the blob v2 extension type, which is a separate
migration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017acNiGMFxRXWVGnpkFFdhK
@github-actions github-actions Bot added the chore Features related to test, build, style improvements label Sep 14, 2026
hamersaw and others added 2 commits September 14, 2026 10:01
Lance 12 resolves the default and stable file format versions to 2.2, and
2.2 rejects the legacy "lance-encoding:blob" encoding outright. The blob
version check treated an unset version and named aliases as unable to
store blob v2, so those tables were written with legacy blob metadata and
failed at creation.

Treat an unset version and stable as blob v2 capable, matching what Lance
resolves them to. An explicit version below 2.2 still selects the legacy
encoding, which remains valid at those versions. legacy maps to 0.1 and
keeps returning false.

The blob v1 suites create their tables without a version, so they now pin
2.1 to go on exercising the v1 path, including the __blob_size and
__blob_pos virtual columns that blob v2 replaces with descriptor struct
fields.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017acNiGMFxRXWVGnpkFFdhK
@hamersaw
hamersaw marked this pull request as ready for review September 14, 2026 17:56

@lance-gatekeeper lance-gatekeeper 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.

⚠️ Gate recommendation: approve with a non-blocking risk.

The v12 API, namespace, transaction, and default/stable blob changes are aligned and exercised across the supported build matrix. The valid next file-format alias still selects legacy blob metadata, so blob table creation fails; users can pin stable or 2.3 as a mitigation.

Please mark this PR with the breaking-change label.

String[] parts = fileFormatVersion.trim().split("\\.");

String trimmed = fileFormatVersion.trim();
if (trimmed.isEmpty() || STABLE_FILE_FORMAT_VERSION.equalsIgnoreCase(trimmed)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

next is also a valid Lance selector and resolves to file format 2.3, but this branch returns false for it. That selects lance-encoding:blob and CREATE TABLE fails instead of creating blob v2. Recognizing next here (or delegating alias resolution when lance-core exposes it) makes aliases follow the same ≥2.2 contract. Users can currently recover by pinning stable or 2.3, so this is non-blocking.

Reproducer

Against this head, run:

spark.sql(
    "CREATE TABLE lance_ns.default.blob_next (id INT, data BINARY) USING lance "
        + "TBLPROPERTIES ('data.lance.encoding' = 'blob', "
        + "'file_format_version' = 'next')");

Expected: the table is created with lance.blob.v2 metadata.

Observed: IllegalArgumentException: Legacy blob columns ... are not supported for file version >= 2.2.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 14, 2026
@FANNG1

FANNG1 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

#819 overlaps this almost exactly — same adaptations, pinned to 12.0.0-beta.18. Happy either way; I'll close or rebase mine to suit.

12.0.0-rc.1 is on Maven Central now, so the dependency should resolve — worth re-triggering CI.

The one real difference is blob encoding when no version is pinned. We agree on stable → v2; we differ on unset: this PR gives blob v2, #819 pins the table to 2.1 and keeps v1. That is user-visible — those columns read back as descriptor structs instead of BINARY and __blob_size/__blob_pos disappear, which is why the v1 suites needed pinning here. Both defensible, just worth deciding deliberately.

FWIW #819 is green on beta.18 including all seven integration jobs. test_create_btree_index_on_int flakes on external-sort memory — it does that on lance 11 too, and passes on re-run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Features related to test, build, style improvements K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants