Repository navigation
Conversation
Specify writer-only bit 20 for inverted index segments whose declared IndexMetadata version is at least 3. Require complete index metadata to be preserved across manifest publications or the write to be refused. Keep reader capability checks separate and document the upgrade and historical-snapshot limitations. Runtime support follows the format vote. Refs: lance-format#9670 Assisted-by: OpenAI Codex (GPT-6)
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Important Format specification voteThis PR modifies the Lance format specification, so it requires 3 binding +1 votes from PMC members (excluding the proposer), at least one of them on the latest commit, and a minimum 72-hour voting period, weekends excluded, before it can merge. Vote by approving this PR (+1) or requesting changes (−1, a veto). See the voting process. Approvals carry over across pushes, so a rebase or a typo fix does not send everyone back to re-vote. Whoever approves the latest commit is vouching that nothing substantive has changed since the earlier approvals; if something has, ask for fresh votes. Status: ❌ Blocked — 0 of 3 required approvals
Updated automatically by the format-spec vote gate, which re-checks every 15 minutes — just voted? Re-check now (press Run workflow; leave the input blank to re-check every open format PR). A PMC member may apply the |
…ters Match versioning.md by clarifying that writers implementing FLAG_VERSIONED_INVERTED_INDEX must set writer feature flag 1 << 23 when publishing a new manifest, while historical unflagged manifests remain valid on read, and regenerate rust/lance-table/src/pb/lance.table.rs.
|
Thanks for the review @Xuanwo. Both items are now addressed:
|
….3 (#11593) Adds two logical types to the table schema spec, `decimal:32:P:S` for Arrow `Decimal32` and `decimal:64:P:S` for Arrow `Decimal64`. This is the spec half of #5174 and follows wjones127's proposal in #5818; the standalone-file gate, the flag and the scale rules came out of Xuanwo's review here. The implementation is #11594. Released Lance versions parse only `decimal:128` and `decimal:256` ("Only Decimal128 and Decimal256 is supported"). So, for a field of either type at any nesting depth, including inside a `fixed_size_list`: - A Lance file, index files included, must use file version 2.3 or later. - A table must have data storage version (`Manifest.data_format.version`) 2.3 or later and set the new feature flag `FLAG_DECIMAL32_AND_DECIMAL64` (`2^23`) in both `reader_feature_flags` and `writer_feature_flags`. Every commit whose schema has such a field sets both bits, and dropping the field, overwriting, restoring or cloning does not clear them. - Readers reject as invalid a file below 2.3 that has such a field, and a manifest that has one with a data storage version below 2.3 or without both bits. The flag keeps out older clients that enforce feature flags. In Xuanwo's review, 14.0.3 and 16.0.0-beta.5 failed to scan a table with these types and no flag, even when projecting only other columns, and 14.0.3 appended rows that left the new fields null. Both builds refuse any table with bit 23 set, on read and on write: `FLAG_UNKNOWN` is `1 << 18` in 14.0.3 and `1 << 23` in 16.0.0-beta.5. As with bit 22 in #10358, this PR reserves the bit: it adds the constant and its half-set check, moves `FLAG_UNKNOWN` to bit 24 and keeps bit 23 unsupported. #11594 turns it on, and I will open a small docs PR marking it supported once #11594 merges. Neither type needs a new physical layout: both are fixed-width 32- and 64-bit values that 2.3 already encodes. Precision is 1-9 for `Decimal32` and 1-18 for `Decimal64`, as in Arrow. These two widths require `0 ≤ S ≤ P`. The existing rule for `decimal:128` and `decimal:256` said `0 ≤ S ≤ P`, although Lance accepts a negative scale for them; this PR changes it to `-128 ≤ S ≤ P`. #10431 and #10459 also claim bit 23. Whichever of the three merges first keeps it. The others move to a free bit everywhere they use 23 (spec and protos, plus any constant, `FLAG_UNKNOWN` and implementation) and have their approvals re-confirmed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Xuanwo
left a comment
There was a problem hiding this comment.
AI-assisted technical review of 9e11e404
The spec still assigns writer bit 23 to FLAG_VERSIONED_INVERTED_INDEX. Main now reserves that bit for FLAG_DECIMAL32_AND_DECIMAL64 (#11593). Please rebase and coordinate with #10431 on a free writer bit distinct from the predicate flag. Keep the spec, protobuf comments, generated text, and corresponding implementation aligned. Merged flag assignment
… move flag bit to 2^25 Upstream main reserved bit 23 for FLAG_DECIMAL32_AND_DECIMAL64 (lance-format#11593), and pending lance-format#10431 reserves bit 24 for FLAG_INDEX_PREDICATES. Coordinate on distinct writer bit 25 (1 << 25) across docs/src/format/table/versioning.md, protos/table.proto, and rust/lance-table/src/pb/lance.table.rs.
|
Thanks @Xuanwo and @Ali2Arslan! Updated in
|
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Verified the author's update: bit 25 agrees across the specification, protobuf comments, generated binding, and PR summary. It is distinct from Decimal32/Decimal64 at bit 23 and pending #10431 at bit 24, resolving the earlier allocation risk.
The writer-only capability remains appropriate for the released-client index-loss path in #9670. This format reservation is ready to accept. Runtime enforcement and regression tests remain follow-up work before activation; deployments must upgrade or stop incompatible writers, including long-lived writers opened before activation.
Summary
Reserve writer-only bit 25,
FLAG_VERSIONED_INVERTED_INDEX, for snapshots containing an inverted index segment withIndexMetadata.index_version >= 3.Refs #9670. A Pylance 8.0.1 writer can load a newer dataset, filter out an unsupported FTS index, and commit an append without that index's metadata. This proposal defines the compatibility boundary that makes such a writer refuse the dataset before committing.
Format contract
IndexMetadataversion, independently ofposting_format_version. Other index types at version 3 are unaffected.The proposal originally targeted bit 20, moved to bit 23 (
1 << 23) infffc0323, and moved to bit 25 (1 << 25) in106e4691after mergingmainthrough #11593 (which reserved bit 23 forFLAG_DECIMAL32_AND_DECIMAL64), leaving bit 24 free for pending #10431 (FLAG_INDEX_PREDICATES) so both proposals reserve distinct bits.Validation
1 << 20; any unknown writer bit exercises the same unrecognized-writer-flag rejection path). BothDataset.insertandwrite_dataset(mode="append")refused before commit on 8.0.1 and 14.0.2. Version and rows stayed unchanged; 14.0.2 could still query the FTS index after every attempt. This is a synthetic compatibility probe, not an implemented writer change.ci/check_proto_comments.py) passes on the updatedprotos/table.proto, and the repository's pinned pre-commit hooks passed on the initial proposal commit98244d2b86c6ebc67d7ef15ae8d399187dff5981.Scope
This is the format proposal for PMC review under the format voting process. It changes only the specification and matching protobuf comments. Runtime flag support, regression tests, and the migration-guide warning will follow after the contract is accepted; this PR does not close the runtime bug.
AI assistance: OpenAI Codex assisted with investigation, drafting, and validation. The commit includes an
Assisted-bytrailer.