Skip to content

feat(dataset): add pagination support for version listing - #11007

Merged
Xuanwo merged 3 commits into
lance-format:mainfrom
MarigWeizhi:weizhi/dataset-versions-pagination
Nov 13, 2026
Merged

Xuanwo merged 3 commits into
lance-format:mainfrom
MarigWeizhi:weizhi/dataset-versions-pagination

Conversation

@MarigWeizhi

@MarigWeizhi MarigWeizhi commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #11006

  • Add Dataset::versions_with_options(offset, limit, descending) so callers can read one page of Version entries instead of every historical manifest. Dataset::versions() delegates to it and still returns the whole history in ascending order, with the same versions, metadata and manifest sizes, scoped to the current branch and excluding detached versions.
  • Only the manifests in the requested page are read, concurrently within the store's effective IO window. A descending page on a lexically ordered store with V2 manifest paths stops listing after offset + limit entries; ascending pages, V1 manifest paths, and stores without lexically ordered listings enumerate every location before selecting the page. None means no limit, 0 returns an empty page without listing or reading, and an out-of-range offset returns an empty page.
  • Expose the same options in Python via LanceDataset.versions(*, offset=0, limit=None, descending=False) and LanceDataset.count_versions(), and in Java via Dataset.listVersions(long offset, Optional<Long> limit, boolean descending).

Test Plan

  • Rust: dataset_versioning suite (203 tests) and test_read_version_transaction_on_branch; a new listing-consumption test (memory V2 descending page of 2 at offset 1 consumes 3 of 5 manifest entries, V1 and local stores consume all 5, zero limit lists nothing) plus the perf(dataset): read manifests concurrently in Dataset::versions #10966 concurrency test in default and LANCE_IO_THREADS=1 configurations.
  • Python: test_versions_pagination on memory:// and local against the extension built from this tree; uv run make lint.
  • Java: DatasetTest (72 tests) against the JNI built from this tree; ./mvnw spotless:check and cargo clippy --tests --manifest-path ./lance-jni/Cargo.toml.
  • Workspace cargo clippy --workspace --all-targets --profile ci --locked -- -D warnings and cargo fmt --all --check.

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

@github-actions github-actions Bot added A-python Python bindings A-java Java bindings + JNI enhancement New feature or request labels Nov 12, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 12, 2026
…ns-pagination

Resolve Dataset::versions overlap with lance-format#10966: versions() now delegates to
versions_with_options(0, None, false), which keeps the ordered buffered
manifest reads that lance-format#10966 introduced.
- versions() stays versions_with_options(0, None, false): ascending, same
  versions, metadata and manifest sizes, branch scoped, detached excluded.
- Document ordering, offset/limit/None/zero, selected-page reads and the
  exact early-listing limits in the Rust, Python and Java surfaces.
- Cover listing consumption with the existing forwarding probe: a
  descending V2 page on a lexically ordered store stops after
  offset + limit manifest entries, so a 2-version page at offset 1
  consumes 3 of 5 entries. V1 names and non-lexically-ordered stores
  still enumerate every location, and a zero limit lists nothing.
- Preserve the lance-format#10966 concurrency test and its effective-window bounds.

Verified by an eager-listing negative control that fails only on the
consumption assertion (5 consumed instead of 3) with the page still
correct, then restored the production source exactly.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 13, 2026

@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 blocking issues found. Focused Rust tests confirm the listing bounds and fallbacks and preserve bounded concurrent manifest reads. The previously tested Python and Java binding implementations are unchanged.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 13, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-verified against current main: the squash result adds exactly the nine accepted files, and the versioning suite plus the manifest-read concurrency probe in both default and single-thread configurations pass on that merged tree. No blocking issues.

@Xuanwo
Xuanwo merged commit 2e1457a into lance-format:main Nov 13, 2026
45 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI A-python Python bindings enhancement New feature or request K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: support pagination and ordering in dataset version listing

2 participants