Skip to main content

materialize_segment_live_rows

Function materialize_segment_live_rows 

Source
pub fn materialize_segment_live_rows(
    blob: &[u8],
    kek: Option<&WalEncryptionKey>,
    schema: &ColumnarSchema,
    deletes: &DeleteBitmap,
    row_surrogates: &[Option<Surrogate>],
) -> Result<Vec<(Value, Option<Surrogate>)>, ColumnarError>
Expand description

Decode the live rows of one flushed segment blob into Value::Objects, paired with their per-row cross-engine surrogate.

  • blob is a raw NDBS (plaintext) or SEGC (encrypted) segment. Encryption is detected from the blob magic: a SEGC blob is decrypted with kek (an error if kek is None); an NDBS blob is read directly.
  • deletes is the segment’s delete bitmap (empty when no rows were deleted). Rows marked deleted are skipped.
  • row_surrogates is the per-row surrogate sidecar for this segment (parallel to segment row order). It may be empty (pre-surrogate snapshot) or shorter than the row count, in which case the missing entries read as None.

Returns (Value::Object, Option<Surrogate>) for every live row, in segment row order. The object keys are the schema column names.