mda — API reference
1/5 types documented. Of 28 public methods, 25 carry their own description, 0 are covered by their type's, and 3 have neither. An entry with no prose below its signature is undocumented in the source, not undocumented here.
CLASS Column
IMPLEMENTS IColumn
mda/src/Column.ev:24
Constructors
INIT(T[] vs)
Adopt a value buffer as an all-present column (the CSV / builder path).
INIT(T[] vs, uint8[] mask)
Adopt a value buffer with an explicit bit-packed validity mask. The mask
must be exactly ceil(n/8) bytes — a length disagreement is a caller
contract violation (programmer error), so it aborts via ASSERT! rather
than a recoverable failure. (Column's methods emit inline as templates,
so a catchable PANIC MdaError here would need MdaError complete at the
template's definition point, which the emitter can't guarantee; the
programmer-error tier is the correct home for this check regardless.)
Methods
METHOD length() RETURNS int64
The number of cells (rows).
METHOD isNull(int64 i) RETURNS boolean
Whether cell i is null — reads the MASK, never the cell (a cell is
always present; IS VALID on it would be E6068). An out-of-range index
is a programmer error, so it aborts via ASSERT!.
METHOD nullCount() RETURNS int64
The number of null cells.
METHOD __op_index__(int64 i) RETURNS MUTABLE REFERENCE T
Reference to cell i — the borrow-propagating ("mirror") accessor: the
result mirrors the receiver's mutability (a mutable Column yields a
MUTABLE REFERENCE for col[i] := v / col[i].f = x, a const receiver a
read-only REFERENCE). Bounds check lives in the value-array subscript.
METHOD fillNull(T v) RETURNS Column[T]
A new column with every null replaced by v (and thus no nulls).
METHOD buffer() RETURNS REFERENCE T[]
Non-owning REFERENCE to the contiguous value buffer — the perf seam
Data's vectorised ops scan. The receiver retains ownership.
NOTE (Bug #298): this method compiles here, but calling it currently
hits a cxx_emit defect — a template-class method returning a value-array
(REFERENCE T[]) is mis-typed to the receiver's class handle at the call
site. Consumer tests for buffer() are gated on that fix.
METHOD sortedIndices(boolean ascending) RETURNS int64[]
A STABLE permutation of [0, length) that reads the column in order,
nulls last. A permutation (int64[]), never a copy of the values — the
one cheap-by-default op, and what Data's groupBy / dedup ride.
NOTE (Bug #298): compiles here, but calling it currently hits the same
cxx_emit defect as buffer() — a template-class method returning a
value-array (int64[]) is mis-typed to the receiver's class handle at
the call site. Consumer tests for sortedIndices() are gated on the fix.
METHOD minimum() RETURNS | T
The smallest present value — FAILURE if every cell is null.
METHOD maximum() RETURNS | T
The largest present value — FAILURE if every cell is null.
METHOD unique() RETURNS Column[T]
The distinct present values, in first-seen order (Data's distinct).
METHOD indexOf(T v) RETURNS int64
Index of the first present cell equal to v, or -1.
CLASS Mda
mda/src/Mda.ev:26
Methods
METHOD transpose(T[,] a) RETURNS T[,]
METHOD row(T[,] a, int64 r) RETURNS Column[T]
METHOD column(T[,] a, int64 c) RETURNS Column[T]
CLASS MdaError
EXTENDS Error
mda/src/MdaError.ev:15
Constructors
INIT(String message)
CLASS TextColumn
IMPLEMENTS IColumn
mda/src/TextColumn.ev:29
Constructors
INIT(String[] vs)
Build an all-present column from a String array (the builder path).
INIT(int64[] offs, binary[] bs, uint8[] mask)
Adopt raw Arrow buffers (the CSV-reader path). offs must be N+1 entries
and mask exactly ceil(N/8) bytes — a disagreement is a caller contract
violation (programmer error), so it aborts via ASSERT!, the same tier
Column[T]'s mask guard uses.
Methods
METHOD length() RETURNS int64
The number of strings (rows) — offsets carries N+1 entries.
METHOD isNull(int64 i) RETURNS boolean
Whether string i is null — reads the MASK, never the cell. An out-of-
range index is a programmer error, so it aborts via ASSERT!.
METHOD nullCount() RETURNS int64
The number of null strings.
METHOD byteLength(int64 i) RETURNS int64
The byte length of string i — offsets[i+1] - offsets[i]. A null string
and a blank string both report 0; use isNull to tell them apart.
METHOD get(int64 i) RETURNS String
Materialise string i (the per-cell path — the vectorised consumers scan
bytes()/offsets() instead). A null string materialises as "".
METHOD offsets() RETURNS REFERENCE int64[]
Non-owning REFERENCE to the offsets — the seam a vectorised consumer walks.
METHOD bytes() RETURNS REFERENCE binary[]
Non-owning REFERENCE to the contiguous UTF-8 bytes — the perf seam.
METHOD sortedIndices(boolean ascending) RETURNS int64[]
A STABLE permutation of [0, length) reading the column in byte-wise
lexicographic order, nulls last. A permutation — never a copy of the
strings; the caller applies it when it materialises.
METHOD unique() RETURNS TextColumn
The distinct present strings, in first-seen order.
METHOD indexOf(String v) RETURNS int64
Index of the first present string equal to v, or -1.
METHOD fillNull(String v) RETURNS TextColumn
A new column with every null replaced by v (and thus no nulls).
INTERFACE IColumn
IColumn — the type-erased face of a column. A Column[T] is homogeneous by
element type, but the Data module's DataFrame holds an ordered set of
columns of differing element types that reads as heterogeneous; it composes
them as an Array[IColumn]. This interface is the null-and-length contract
every column kind shares, independent of its element type — the surface a
frame needs to report shape and count nulls without knowing the cell type.
mda/src/interfaces.ev:14
Methods
METHOD length() RETURNS int64
The number of cells (rows) in the column.
METHOD isNull(int64 i) RETURNS boolean
Whether the cell at i is null (reads the validity mask, never the cell).
METHOD nullCount() RETURNS int64
The number of null cells.