ddn.columnar.types

The logical types of ddn.df: Kind, TimeUnit, DataType, the physical and logical type maps, the supported element types and the arithmetic supertype (D4, D5; ADR-2026-10-18-03).

Types 13

enumKind : ubyte

Logical type kind of a DataType (D4, ADR-2026-10-18-03).

BOOLEANPacked bits; validity and values share the `Bitmap` representation.
INT8
INT16
INT32
INT64
UINT8
UINT16
UINT32
UINT64
FLOAT32
FLOAT64
STRINGUTF-8 bytes plus 64-bit offsets (Arrow large-string layout).
DATETIMENanoseconds since the Unix epoch; element type `Timestamp`.
TIMENanoseconds of day; element type `TimeOfDay`.
DATEDays since the Unix epoch (i32, the Arrow `date32` shape); element type `Date` (ADR-2026-10-30-02).
DURATIONFixed nanoseconds (i64); element type `long` via the `dur*` constructors (ADR-2026-10-30-02). Calendar lengths are operations, never storage.
LISTOffsets into a child chunk; the element type is the metadata's `element` (ADR-2026-10-23-13; one level in this tier).
STRUCTNamed field chunks in `children`; the metadata holds the ordered field names.
CATEGORICALDictionary codes; the labels live in `children[0]`.
DECIMALExact fixed-point coefficients (ADR-2026-10-23-13); the metadata holds precision and scale.
enumTimeUnit : ubyte

Resolution of a temporal kind. Phase 1 fixes NANOSECONDS, which is what Timestamp stores; the enum exists so later kinds (microseconds, days) do not break user switches.

NANOSECONDS
structTypeMeta

A logical type: the kind plus its parameters (D4, ADR-2026-10-18-03). Starting from a bare Kind enum and switching to a parameterised struct later would break every user switch; a struct whose parameter-less kinds read like enum members (DataType.INT64) costs nothing. POD, 2 bytes, usable as an associative-array key and in a final switch (dtype.kind). The parameter metadata of the richer kinds (ADR-2026-10-23-13): null (meta is null) for the fourteen flat kinds. GC-owned, so children and dictionaries share the chunk model's lifetime automatically.

Fields
Kind elementLIST: the child element's kind (flat kinds in this tier; nested lists would need a deeper structure).
string[] fieldsSTRUCT: the ordered field names (`fields.length` children).
Kind dictionaryCATEGORICAL: the labels' kind (STRING in this tier).
ubyte precisionDECIMAL: storage digits, one of 2, 4, 9, 18, 38.
ubyte scaleDECIMAL: fraction digits (`0 .. precision`).
Methods
TypeMeta of(DataType element) static @safe pure nothrowThe LIST metadata constructor.
TypeMeta of(string[] fields) static @safe pure nothrowThe STRUCT metadata constructor.
TypeMeta ofCategorical(DataType dictionary) static @safe pure nothrowThe CATEGORICAL metadata constructor.
TypeMeta of(ubyte precision, ubyte scale) static @safe pure nothrowThe DECIMAL metadata constructor.
structDataType
Fields
Kind kindThe logical kind.
TimeUnit unitTemporal resolution; only `TimeUnit.NANOSECONDS` exists in phase 1.
TypeMeta metaThe richer kinds' parameter metadata; `null` for flat kinds (ADR-2026-10-23-13).
DataType BOOLEANThe BOOLEAN type.
DataType INT8The INT8 type.
DataType INT16The INT16 type.
DataType INT32The INT32 type.
DataType INT64The INT64 type.
DataType UINT8The UINT8 type.
DataType UINT16The UINT16 type.
DataType UINT32The UINT32 type.
DataType UINT64The UINT64 type.
DataType FLOAT32The FLOAT32 type.
DataType FLOAT64The FLOAT64 type.
DataType STRINGThe STRING type (UTF-8, large-offset layout).
DataType DATETIMEThe DATETIME type (nanoseconds since the Unix epoch).
DataType TIMEThe TIME type (nanoseconds of day).
DataType DATEThe DATE type (i32 days since the epoch; ADR-2026-10-30-02).
DataType DURATIONThe DURATION type (i64 fixed nanoseconds; ADR-2026-10-30-02).
Methods
bool opEquals(const DataType other) const @safe pure nothrowLogical equality: same kind and same unit, independent of how the value was constructed.
private bool metaEquals(const DataType other) const @safe pure nothrow
size_t toHash() const @safe pure nothrowHash consistent with `opEquals`, so `DataType` works as an associative-array key.
string toString() const @safe pure nothrowRenders the type for display: the kind name (`"INT64"`, `"DATETIME"`). The unit is fixed in phase 1 and not printed.
bool isNumeric() const @safe pure nothrowReturns: `true` for the integer and float kinds (not BOOLEAN).
bool isInteger() const @safe pure nothrowReturns: `true` for the signed and unsigned integer kinds.
bool isSigned() const @safe pure nothrowReturns: `true` for the signed integer kinds.
bool isFloat() const @safe pure nothrowReturns: `true` for FLOAT32 and FLOAT64.
bool isTemporal() const @safe pure nothrowReturns: `true` for DATETIME and TIME.

How Series.fillNull replaces null slots.

FORWARDNulls take the value of the previous valid row (leading nulls stay).
BACKWARDNulls take the value of the next valid row (trailing nulls stay).
MEANNulls take the arithmetic mean of the valid values (numeric columns only; integers promote to FLOAT64).
MEDIANNulls take the median (the 0.5 quantile) of the valid values (numeric columns only; integers promote to FLOAT64).

The frame-level null-drop criterion (DataFrame.dropNulls).

ANYDrop a row when any selected column is null.
ALLDrop a row only when every selected column is null.

The regex replacement scope (strReplaceRegex).

ALLReplace every match (the literal op's default too).
FIRSTReplace the first match only.
structDate

A calendar date: days since the Unix epoch, i32, proleptic Gregorian (ADR-2026-10-30-02) - the element type of DATE columns (the Arrow date32 shape). No timezone, no time of day.

Fields
int daysDays since 1970-01-01 (negative before the epoch).
Methods
Date fromYMD(long year, uint month, uint day) static @safe pureConstructs from calendar parts, validated (the proleptic Gregorian calendar: `month` 1..12, `day` 1..the month's length with leap years).
void toYMD(out long year, out uint month, out uint day) const @safe pure nothrowThe civil parts (Howard Hinnant's civil-from-days; the same algorithm the UTC accessors use, correct for pre-epoch days).
long year() const @safe pure nothrowThe civil year (proleptic Gregorian).
uint month() const @safe pure nothrowThe month of year (`1..12`).
uint day() const @safe pure nothrowThe day of month (`1..31`).
Date ofTimestamp(Timestamp t) static @safe pureThe date of the instant `t` (floor toward negative infinity - pre-epoch instants stay on their day).
Timestamp toTimestamp() const @safe pure nothrowThe instant of this date at UTC midnight.
string toString() const @safe pure nothrowRenders as strict ISO `YYYY-MM-DD` (zero-padded four-digit year; a leading `-` for negative years beyond four digits).
bool opEquals(const Date other) const @safe pure nothrowValue equality: same day count.
bool isLeapYear(long year) static @safe pure nothrowDitto, the proleptic leap-year rule.
aliasFlatKinds = AliasSeq!( Kind.BOOLEAN, Kind.INT8, Kind.INT16, Kind.INT32, Kind.INT64, Kind.UINT8, Kind.UINT16, Kind.UINT32, Kind.UINT64, Kind.FLOAT32, Kind.FLOAT64, Kind.STRING, Kind.DATETIME, Kind.TIME, Kind.DATE, Kind.DURATION)

Every Kind, in declaration order (the static foreach sequence). The flat kinds: every pre-Tier-3 consumer's dispatch domain. The richer kinds (LIST, STRUCT, CATEGORICAL, DECIMAL) dispatch through their own layers and take explicit unsupported rejections in the final switches (ADR-2026-10-23-13).

Every kind, flat and rich - for metadata/render tests.

aliasNumericKinds = AliasSeq!( Kind.INT8, Kind.INT16, Kind.INT32, Kind.INT64, Kind.UINT8, Kind.UINT16, Kind.UINT32, Kind.UINT64, Kind.FLOAT32, Kind.FLOAT64)

The numeric Kinds: the integers and floats, without BOOLEAN.

The calendar unit (truncateCalendar; ADR-2026-10-30-02).

YEARThe calendar year boundary.
QUARTERThe quarter boundary (months 1/4/7/10).
MONTHThe month boundary.
WEEKThe ISO week (Monday-anchored).
DAYThe UTC day boundary.
enumClosed

The between range closure (ADR-2026-10-30-02).

BOTHBoth endpoints inclusive.
LEFTThe left inclusive, the right exclusive.
RIGHTThe left exclusive, the right inclusive.
NONEBoth endpoints exclusive.

Functions 17

fnvoid daysToYMD(long days, out long year, out uint month, out uint day) @safe pure nothrow
fnlong ymdToDays(long year, uint month, uint day) @safe pure nothrow
private fnsize_t putDigits(ref char[16] buf, size_t at, long v, uint width) @safe pure nothrow
private fnstring formatSmall(long v) @safe pure nothrow
fnlong durNanos(long v) @safe pure nothrow @nogcThe semantic duration constructors (ADR-2026-10-30-02): the DURATION element type is plain `long` nanoseconds - these name the units. Every product wraps like D (`durDays(long.max)` wraps).
fnlong durMicros(long v) @safe pure nothrow @nogcDitto, microseconds.
fnlong durMillis(long v) @safe pure nothrow @nogcDitto, milliseconds.
fnlong durSeconds(long v) @safe pure nothrow @nogcDitto, seconds.
fnlong durMinutes(long v) @safe pure nothrow @nogcDitto, minutes.
fnlong durHours(long v) @safe pure nothrow @nogcDitto, hours.
fnlong durDays(long v) @safe pure nothrow @nogcDitto, days (86 400 seconds exactly - fixed lengths).
fnlong durWeeks(long v) @safe pure nothrow @nogcDitto, weeks (seven fixed days).
private fnbool isSignedKind(Kind k) @safe pure nothrowReturns: `true` for the signed and unsigned integer kinds.
private fnushort widthOf(Kind k) @safe pure nothrowReturns: the storage width in bits of an integer or float kind.
private fnKind signedOfWidth(ushort bits) @safe pure nothrowReturns: the signed integer kind of `bits` bits (8, 16, 32 or 64).
fnDataType supertypeOf(DataType a, DataType b) @safe pureThe common dtype both operands of an arithmetic operation are cast to before the kernel runs (D12, ADR-2026-10-18-05; one dispatch on one kind, fourteen instantiations per operation, not 196).
private fnstring digit(ubyte v) @safe pure nothrow

Templates 5

tmplPhysicalOf(Kind K)

The physical storage type of a kind (D5, ADR-2026-10-18-03): the D type of the same width for the integer and float kinds, long for DATETIME and TIME. BOOLEAN and STRING have no scalar physical type — their storage is packed bits and offsets-plus-bytes, handled by BooleanArray and StringArray — so the alias is void for them and kernels over physical types are constrained to the numeric and temporal kinds.

See Also

LogicalOf, NumericKinds
tmplLogicalOf(Kind K)

The logical element type of a kind (D5, ADR-2026-10-18-03): Timestamp for DATETIME, TimeOfDay for TIME, and the physical (scalar) type for everything else (bool for BOOLEAN, string for STRING). The logical layer owns display, legality and the typed conversion in get!T.

See Also

PhysicalOf
tmplkindOf(T)

The Kind whose logical element type is T.

Parameters

Tone of the fourteen supported element types

Returns

the matching Kind manifest constant.
tmplisSupportedElement(T)

true when T is one of the supported element types.

tmplisSupportedScalar(T)

true when a value of T may appear as the scalar side of a Series operation. The same set as isSupportedElement; individual operations narrow it further (arithmetic rejects STRING and the temporal kinds, comparisons require the same kind).