Repository navigation
Conversation
81ad0f9 to
be95d12
Compare
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
1d12a6e to
db6f582
Compare
7690b0c to
8683af9
Compare
|
It looks like our work crossed in flight: #11260 and #11261 also address #11180, covering vector and FTS merges by retaining per-source overlay freshness. Your PR takes the other approach discussed in #10884: refreshing stale rows against the merge snapshot. It also goes beyond #11180 by bringing the other scalar indices up to date. There is direct overlap in the FTS and shared merge lifecycle code, so I would like to coordinate rather than have us maintain competing FTS fixes. One possible split would be for this PR to own the scalar/FTS refresh, while I narrow #11260 and #11261 to the vector case. #11180 could then remain open until both the vector and FTS parts land. What do you think? We can move the design discussion to #11180 so that everyone involved has the full context. |
8683af9 to
e0c153a
Compare
## 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`.
e0c153a to
b57edca
Compare
…11283) Split out from #11273. Arrow permits a null list to span a non-empty range in the child array. LabelList used the offsets alone when flattening lists, so a label stored under a null parent could acquire a posting for that row. Build and update now read each parent row's address once during list expansion. A valid list pairs its labels with that address. A null list contributes its address to the list-null bitmap and emits no postings. The expansion reuses the sliced child array when there are no hidden values to remove. The regression test inspects the stored index for both List and LargeList. It checks that a hidden label has no posting, the null list is still recorded, and a null element inside a valid list retains its posting. All 23 LabelList unit tests passed locally, including both new regression cases. Formatting passed. Workspace Clippy on macOS arm64 stopped in unchanged byte_stream_split.rs at lines 358 and 393 (unreachable expressions after the NEON dispatch).
…ation (#11274) Split out from #11273. Deleting a row leaves its stable ID in the fragment’s row ID sequence. When a scalar index selects the whole fragment, address-to-ID translation copies that sequence and includes the deleted row. Selecting the same physical offsets individually already skips it (#7918). Apply the fragment’s deletion vector before adding its IDs to the result. With no deletions, the existing range-based conversion is unchanged. With deletions, only the deleted offsets need individual translation. The regression test deletes ID 7 from a fragment containing IDs 5–9. On `main`, whole-fragment translation returned `[5, 6, 7, 8, 9]`. With this change, both selection forms returned `[5, 6, 8, 9]`. `cargo fmt --all` and Clippy for the `lance` crate (library and tests) passed. Workspace Clippy on macOS arm64 stops on existing unreachable expressions in `byte_stream_split.rs` (lines 358 and 393).
b57edca to
53cf765
Compare
53cf765 to
65f406b
Compare
Closes #11272. This addresses the full-text search (FTS) part of #11180.
Summary
A scalar index merge can combine segments built before and after the same data overlay. This draft refreshes each source against the snapshot used for the merge. It uses the source’s fragment coverage, indexed fields and build version to decide which entries need replacing. Once the indexed values and row references are current, the output segment can record the merge snapshot’s
dataset_version.optimize_indices, explicit segment merges, and distributed optimize share the overlay refresh logic.fast_searchand indexes updated documents from older inputs. ZoneMap and BloomFilter can rebuild summaries for affected fragments.Validation
cargo fmt --allandgit diff --checkpassed.lance-encoding/src/encodings/physical/byte_stream_split.rs(lines 358 and 393).