/** * The Dremel core: turning rows of lists into the three flat streams Parquet * actually stores. * * Parquet keeps no brackets. A list column is stored as the leaf values laid * end to end, plus two integer streams that let a reader rebuild the shape: * * - **repetition level** — 0 starts a new ROW, 1 continues the current list; * - **definition level** — how deep the value actually exists, which is how * an empty list and a missing element are expressed without a value. * * Our schema is exactly one level of repetition: * * required group (LIST) { * repeated group list { * required|optional element * } * } * * so max rep is 1, and max def is 1 (required element) or 2 (optional). The * outer group is REQUIRED because we cannot produce "no list at all" — an empty * cell is an empty list — and declaring OPTIONAL would spend a level on a state * we never emit. * * Kept apart from the writer so it can be checked on its own against * hand-computed levels; getting these two streams wrong produces a file that * readers accept and then mis-assemble, which is the worst possible failure. * Spec: docs/specs/2026-07-19-repeated-values-lists-and-mix-ground-truth.md §5. */ /** One column's worth of rows, already split into elements. */ export type ListRows = readonly (readonly string[])[]; export interface ListLevels { /** Raw text of the elements that are present; NULL elements contribute none. */ readonly present: string[]; readonly repLevels: number[]; readonly defLevels: number[]; readonly maxDef: number; readonly maxRep: number; } /** Max definition level for a list whose element is (or is not) nullable. */ export declare function listMaxDef(elementNullable: boolean): number; /** Bits needed to hold levels up to `maxLevel`; 0 when there is nothing to say. */ export declare function levelBitWidth(maxLevel: number): number; /** * Build the value/rep/def streams for one list column. * * An element is NULL when its text is empty AND the element type is nullable — * the same rule the scalar path uses, so `missing=` behaves identically whether * or not the column repeats. When the element is not nullable an empty string * is a legitimate empty value and is passed through to conversion, which will * reject it if the type cannot hold it. */ export declare function buildListLevels(rows: ListRows, elementNullable: boolean): ListLevels; //# sourceMappingURL=list.d.ts.map