Expand description
Data overlay files.
An overlay file supplies new values for a subset of (physical offset, field)
cells within a fragment, without rewriting the fragment’s base data files. See
the Data Overlay Files specification for the full rules; the invariants this
module relies on are:
- Physical-offset coverage. Coverage bitmaps index physical row offsets (positions in the base data files, counting deleted rows), so they are stable across deletions, like deletion vectors.
- Rank-based values. The overlay’s
data_filestores one value column per field, with no row-offset key column. Within a value column, a covered offset’s value sits at its rank — the 0-based count of set bits below it in that field’s coverage bitmap. - Dense vs. sparse coverage. A dense overlay shares one bitmap across every
field (
OverlayCoverage::Shared); a sparse overlay carries one bitmap per field (OverlayCoverage::PerField). - Parse once. Bitmaps are parsed from their 32-bit Roaring encoding a single
time when the fragment loads and held behind an
Arc, so cloning a fragment is cheap. - Newest-last ordering. A fragment’s overlays are stored newest-last and
stable-sorted by
committed_versionon load (seesort_overlays_newest_last), with list position breaking ties for equal versions. When two overlays cover the same(offset, field), the highercommitted_versionwins. - Field tombstones. When new base values are written for a field (a
DataReplacement, or an in-place column rewrite), any overlay value for that
field is stale and must stop shadowing the fresh base. The field is marked
obsolete in the overlay’s
data_file.fieldswithTOMBSTONE_FIELD_ID(the same sentinel used for obsolete base columns) rather than physically removed, so the overlay’s other fields — and its coverage positions — stay intact (seetombstone_overlay_fields).
Structs§
- Data
Overlay File - An overlay file supplies new values for a subset of
(physical offset, field)cells within a fragment, without rewriting the fragment’s base data files. See the module documentation for the coverage, rank, and versioning rules.
Enums§
- Overlay
Coverage - Which
(physical offset, field)cells aDataOverlayFileprovides values for.
Constants§
- TOMBSTONE_
FIELD_ ID - Field-id sentinel marking a tombstoned (obsolete) field within an overlay’s
data_file.fields. Matches the tombstone convention for obsolete columns in base data files; a tombstoned field’s values are ignored on read.
Functions§
- sort_
overlays_ newest_ last - Stable-sort a fragment’s overlays newest-last by
committed_version. The stable sort preserves list position as the tiebreak for equal versions, so resolution can rely on the ordering without re-checking. See the module documentation for the ordering invariant. - tombstone_
overlay_ fields - Tombstone
fieldsacross a fragment’soverlays, dropping any overlay left with no live fields. - verify_
overlays_ newest_ last - Verify a fragment’s overlays are stored newest-last (non-decreasing
committed_version), the ordering invariant readers rely on for resolution. Returns an error identifying the first out-of-order pair.