ddn.columnar.structs

The struct-column layer of ddn.df (ADR-2026-10-23-13/-14): named field chunks in children[i] with parent validity marking whole-struct nulls, distinct from a valid struct of null fields. Field order is pinned by the metadata's fields; duplicate names are construction errors.

Types 1

Builds one STRUCT chunk from field chunks: each field's chunk must carry exactly length elements (validated); the parent's validity marks whole-struct nulls; field values under a null parent are never read.

Fields
private string[] _fields
private ArrayData[] _fieldChunks
private ulong[] _validity
private size_t _length
private bool _anyNull
private bool _sealed
Methods
void field(size_t i, ArrayData chunk) @safe pure nothrowSets the field chunk for field `i` (must carry `length` elements; validated at finish).
void markNull(size_t i) @safe pure nothrowMarks row `i` as a null struct (the whole row).
void length(size_t n) @safe pure nothrowMarks rows `0 .. n` as the struct count.
private void ensureValidity(size_t i) @safe pure nothrow
ArrayData finish() @safeSeals the STRUCT chunk.
private size_t countValid() @safe pure nothrow
Constructors
this(string[] fields)Params: fields = the ordered field names (duplicates rejected at finish)

Functions 9

fnvoid validateStructChunk(const ArrayData chunk) @safeValidates a STRUCT chunk: field count matches the metadata, field chunks carry the parent's length, no duplicate names.
fnSeries structField(Series s, string name) @trustedExtracts one field as its own Series (the field chunks gathered into one Series of the field's dtype).
private fnArrayData combineStructValidity(const ArrayData parent, const ArrayData win) @trusted pure nothrow
private fnsize_t fieldIndexOf(DataType dtype, string name) @safe pure nothrow
fnSeries structSeries(string name, string[] fieldNames, Series[] fields) @trustedBuilds a STRUCT Series from its field Series (equal lengths, ordered names).
private fnvoid enforceFlatField(string fieldName, DataType dtype) @safe
private fnArrayData[] fieldWindows(const ArrayData[] chunks, size_t f)
fnArrayData structTake(const ArrayData[] chunks, const size_t[] chunkStarts, const(size_t)[] indices, DataType dtype) @trusted
fnArrayData structRechunk(const ArrayData[] chunks, DataType dtype) @trusted