ddn.columnar.batch

The structural storage carrier beneath DataFrame.

This module owns the structural half of a table: Field and Schema (the ordered shape) and ColumnBatch (equal-height, uniquely named columns). It is deliberately free of table semantics - no join, groupBy, expression, sort or IO logic enters here - and it never copies or rechunks its columns: independently chunked columns stay independently chunked, because physical batch alignment is a codec concern, not a carrier concern.

DataFrame wraps a ColumnBatch instead of keeping a second column store; the old ddn.df.frame spellings of Field and Schema remain available as re-exports. The query engine's ColumnSchema (nullability and cardinality facts) is a different contract and stays with the expression layer.

Types 3

structField

One named, typed column of a Schema.

Fields
string nameThe column name.
DataType dtypeThe column dtype.
Methods
bool opEquals(const Field other) const @safe pure nothrowField equality: same name and dtype.
structSchema

An ordered collection of fields: the shape a DataFrame conforms to. vstack requires schema equality; readCsv takes one as input.

Fields
private Field[] _fields
Methods
Field[] fields() @safe pure nothrowReturns: the fields, in column order.
size_t length() const @safe pure nothrowReturns: the number of fields.
Nullable!Field field(string name) const @trusted pureFinds a field by name.
Nullable!size_t indexOf(string name) const @safe pureFinds the position of a field by name.
bool opEquals(const Schema other) const @safe pure nothrowSchema equality: same fields in the same order.
Constructors
this(Field[] fields)Constructs from fields (kept as a copy).

A structural batch of equal-height, uniquely named columns: the storage carrier DataFrame wraps. ColumnBatch.init is the empty batch (no columns, height 0). A typed batch of zero rows keeps its schema.

Fields
private Series[] _columns
Methods
Series[] columns() @safe pure nothrowReturns: the columns, in order (no copy; chunking is preserved).
size_t height() const @safe pure nothrowReturns: the number of rows (0 for the empty batch).
size_t width() const @safe pure nothrowReturns: the number of columns.
size_t[2] shape() const @safe pure nothrowReturns: `(height, width)`.
string[] names() @safe pure nothrowReturns: the column names, in order.
Schema schema() @safe pureReturns: the structural schema of the batch.
DataType[] dtypes() @safe pure nothrowReturns: the column dtypes, in order.
bool isEmpty() const @safe pure nothrowReturns: `true` when the batch has no rows or no columns.
Series column(string name) @safe pureParams: name = the column name
Series opIndex(string name) @safe pureReturns: the named column.
Constructors
this(Series[] columns)Constructs from columns, validating equal heights and unique names.