Repository navigation
refactor(dataset): unify ManifestWriteConfig into ManifestBuildConfig - #11391
Merged
Merged
Conversation
Remove the redundant lance::dataset::ManifestWriteConfig mirror and pass lance_table::format::ManifestBuildConfig directly through commit and manifest-building paths. Key changes: - Encapsulate ManifestBuildConfig with builder methods, remove dead use_legacy_format, and model stable row ID / migration activation as a single coherent state so migration activation always implies stable row IDs. - Keep manifest build timestamps optional until resolved once per commit attempt in lance's mockable clock path, sharing the resolved timestamp between build_manifest and write_manifest_file. - Replace commit_transaction's 10 positional arguments with crate-internal CommitTransactionOptions and move tagged_frag_reuse_trim out of manifest build config onto Dataset::apply_tagged_frag_reuse_trim. - Embed ManifestBuildConfig inside CommitBuilder instead of mirroring its fields.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
BubbleCal
approved these changes
Nov 23, 2026
Xuanwo
added a commit
that referenced
this pull request
Nov 24, 2026
## Problem Every scalar index merge repeated the same field and declaration validation, row-domain guard, per-segment filters, destination store allocation, source opening/downcast, and `IndexMetadata` assembly. Bitmap also depended on btree for its empty new-data stream, and append's merge dispatch rebuilt the same filters per arm. ## Change Add `scalar/segment_merge.rs` to own the shared merge inputs and output: - empty groups, keyed field/path and same-declaration checks - per-type stable-row-id legacy guard, preserving Bitmap/BTree/LabelList/MinHash bottom-level mixed-domain errors; RTree/NGram keep the shared-domain guard - per-segment filters and coverage unions - typed source opening/downcast - UUID/store allocation and one metadata constructor - the empty value/address stream used by pure consolidation All scalar merge modules now use it; Bitmap no longer reaches into btree. `append.rs` constructs filters once for the simple merge primitives. MinHash keeps its historical admission rule: non-stable tables can merge disjoint v0 and v1 segments into v1, while stable tables still reject legacy input. No public API, persisted format, or Python wrapper changes. #11273, #11231 and #11280 are complementary and not dependencies; their behaviors are not pulled in here. Overlap is mechanical in the same scalar modules and append dispatch. Current main's #11290 only changes tagged FRI retention bookkeeping and #11391 changes commit configuration; neither changes a caller contract used by this change. ## Validation - `cargo fmt --all -- --check`: pass - `cargo clippy --all --tests --benches --profile ci -j 4 -- -D warnings`: pass (only existing lance-linalg build-script notices) - Runtime on head `d23cbafd5`, one test executable, 49 unique tests: - scalar MinHash module: 16 passed, including mixed v0-layout/v1 disjoint merge, commit, reopen and `fast_search` for both stable and non-stable datasets, plus the historical-layout legacy regression - `index::tests::merge`: 8 passed - append/optimize: BTree 9, Bitmap 7, NGram 1, BloomFilter 4, FTS 3, scalar stale-row 1 No released MinHash v0 fixture exists; the v0 layout is reconstructed from a current segment (`_rowid`, version 0) by the test helper. The test exercises real merge, commit, reopen and search rather than mocked metadata. Remaining coverage: the full workspace test matrix and a Python wheel were not run. The Python wrapper is unchanged, and the mixed historical layout is not constructible through it. Clean merge tree with current main `e90fe4b8e7c8c819bb51171a43fc94d01b40e2c7`: `bdbb1029cd3e7ab3a54ac3036d258cd4e6dcbcaa`.
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.
lance::dataset::ManifestWriteConfigmirroredlance_table::format::ManifestBuildConfigfield-for-field, whileCommitBuilderduplicated several of the same fields again and carried a deaduse_legacy_formatoption alongside a commit-loop-onlytagged_frag_reuse_trimflag.This change removes
ManifestWriteConfigand passeslance_table::format::ManifestBuildConfigdirectly throughCommitBuilder,Dataset, andio::commit:ManifestBuildConfigis now encapsulated behind builder and getter methods, drops the unuseduse_legacy_formatfield, and encodes stable row ID / migration activation as a single internal state so migration activation always implies stable row IDs.ManifestBuildConfig::timestamp_nanosis optional (Option<u128>) solance-tablestays independent oflance's mockable clock; each commit attempt resolves the timestamp once inlance::io::commitand shares it across manifest construction andwrite_manifest_file.commit_transactiontakes a crate-internalCommitTransactionOptionsinstead of 10 positional arguments, andtagged_frag_reuse_trimmoves out of manifest configuration ontoCommitTransactionOptions/Dataset::apply_tagged_frag_reuse_trimbecause it only affects transaction-rebase handling during commit attempts.CommitBuilderstate:CommitBuilderstores aManifestBuildConfigdirectly while keepinguse_stable_row_ids: Option<bool>separate so existing datasets continue to inherit their manifest setting unless migration activation overrides it.Migration for Rust callers
ManifestBuildConfigfields are now private. Construct it withManifestBuildConfig::new()(orDefault) and thewith_*methods. The defaults are unchanged:auto_set_feature_flags = true, no timestamp, stable row IDs inherited, and transaction files enabled.auto_set_feature_flags: false.with_auto_set_feature_flags(false)timestamp_nanos: nanos.with_timestamp_nanos(nanos)use_stable_row_ids: true.with_use_stable_row_ids(true)migration_next_row_id: Some(n).with_migration_next_row_id(n)storage_format: Some(format).with_storage_format(format)disable_transaction_file: true.with_disable_transaction_file(true)activate_non_reusable_field_ids: true.with_activate_non_reusable_field_ids(true)clustering_definitions: Some(list).with_clustering_definitions(list)spilled_row_lineage: lineage.with_spilled_row_lineage(lineage)timestamp_nanos()now returnsOption<u128>. Set a caller-owned timestamp with.with_timestamp_nanos(nanos); thelancecommit paths resolve it per attempt. An unset value inbuild_manifestorrestore_old_manifesthas the same result as the old explicit0and is not a new regression, but directlance-tablecallers that persist the manifest themselves should set it if they need a version timestamp.use_legacy_formatis removed. Its branches only applied whenstorage_formatwasNone, andstorage_formattook precedence; the replacement for explicit selection is:The former
use_legacy_formatvalues map toConcreteFileVersion::V1forSome(true),ConcreteFileVersion::V2_0forSome(false), and to omittingwith_storage_formatforNone.storage_formatstill takes precedence.BREAKING CHANGE:
ManifestBuildConfigfields are private anduse_legacy_formatis removed; migrate toManifestBuildConfig::new()and thewith_*methods above. Directlance-tablecallers that need a version timestamp should set.with_timestamp_nanos(...).