Repository navigation
feat(csr)!: load stored csrs without writing them - #191
Merged
Merged
Conversation
Deploying lance-csr with
|
| Latest commit: |
8d4e929
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://09a5d8dc.lance-csr.pages.dev |
| Branch Preview URL: | https://feat-csr-load-only.lance-csr.pages.dev |
Add persist_csr="load" (PersistCsr::Load in Rust, persistCsr: "load" in Node): an engine loads a stored CSR when it can and otherwise builds in memory, never writing to its datasets. delete_stored_csr() refuses on such an engine. With storing on, check that _lance_csr takes writes before encoding the file, so read-only storage no longer pays for an encode it can't upload. A failed write is now reported as store_error in csr_stats() and as a Python RuntimeWarning or a Node process warning. Closes #180.
prrao87
force-pushed
the
feat/csr-load-only
branch
from
November 21, 2026 21:21
b04ab36 to
8d4e929
Compare
prrao87
marked this pull request as ready for review
November 21, 2026 21:25
prrao87
added a commit
that referenced
this pull request
Nov 21, 2026
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.
Why
Closes #180. Some clients only read graphs that another process writes, such as a graph browser over published Lance tables, and must never change the source datasets. On
mainthe only way to load a stored CSR ispersist_csr=True, and that same option writes_lance_csr/<version>.arrowinto the dataset whenever the engine has to build. Two smaller problems came with it. On read-only storage the engine compressed the whole file before discovering that the write fails, which cost about 1.6 s on the LANL graph in the issue. And the failure was only logged through Rust'slogcrate, so Python and Node callers never saw it.What changed
persist_csrgains a load-only value next to the existing booleans:FalsefalsePersistCsr::Off"load""load"PersistCsr::LoadTruetruePersistCsr::LoadAndStorecheckout_latest()andoptimize_csr()aren't stored either, anddelete_stored_csr()refuses (ValueErrorin Python,InvalidArgumentin Node)..write-probein_lance_csrbefore encoding. Read-only storage now fails there in milliseconds instead of after the encode.store_error(storeErrorin Node) incsr_stats(). It stays set while the engine keeps that CSR. Python also emits aRuntimeWarningand Node aLanceCsrWarningprocess warning when a new error appears after creating the engine,checkout_latest(),optimize_csr()oroptimize_datasets().Breaking for Rust only.
EngineOptions::persist_csrchanges frombooltoPersistCsr, sopersist_csr: truebecomespersist_csr: PersistCsr::LoadAndStore. Python and Node callers that pass booleans see no change.Validation
delete_stored_csr()refuses, and a dataset that can't be written fails at the probe withstore_errorset.store_error.cargo test --workspace, the Python suite with doctests (1,748 passed, 1 skipped) and the Node suite (87 passed) pass locally.cargo fmt,cargo clippy --workspace --all-targets -- -D warnings, Clippy on the Node crate,make lint,npm run lint, the regenerated TypeDoc reference,zensical build --strictandtypospass.persist_csrtakes the same path as before. The only new cost is one empty write and delete per stored full build.🤖 Generated with Claude Code