Public column type for a schema's key column, narrowed by the
first-column kind. Mirrors PublicColumnForKind on the value
side. Used by the schema-narrowed TimeSeries.keyColumn()
signature (RFC §7.5) so a time-keyed series returns
TimeKeyColumn, an interval-keyed series returns
IntervalKeyColumn, etc., without a cast at the consumer site.
Implemented in two steps so the inner conditional distributes
over the kind union — S[0]['kind'] is a union for a broad
S like SeriesSchema, and a non-naked conditional check
would collapse to never rather than producing the matching
key-column union. The KeyColumnForKind<K> helper takes K as
a naked type parameter so distribution applies; a
TimeSeries<SeriesSchema>.keyColumn() then types as
TimeKeyColumn | TimeRangeKeyColumn | IntervalKeyColumn as
expected. Closes Codex finding on PR #159.
Why a single concrete class per kind (no chunked variant)? Key
columns are never chunked in the substrate — ColumnarStore's
key column is the single source of truth for row ordering, and
chunked storage shows up only on the value side (typically post-
concatSorted). If chunked keys ever land they'll widen this
type the same way PublicColumnForKind widens for values.
Public column type for a schema's key column, narrowed by the first-column kind. Mirrors
PublicColumnForKindon the value side. Used by the schema-narrowedTimeSeries.keyColumn()signature (RFC §7.5) so atime-keyed series returnsTimeKeyColumn, aninterval-keyed series returnsIntervalKeyColumn, etc., without a cast at the consumer site.Implemented in two steps so the inner conditional distributes over the kind union —
S[0]['kind']is a union for a broadSlikeSeriesSchema, and a non-naked conditional check would collapse toneverrather than producing the matching key-column union. TheKeyColumnForKind<K>helper takesKas a naked type parameter so distribution applies; aTimeSeries<SeriesSchema>.keyColumn()then types asTimeKeyColumn | TimeRangeKeyColumn | IntervalKeyColumnas expected. Closes Codex finding on PR #159.Why a single concrete class per kind (no chunked variant)? Key columns are never chunked in the substrate —
ColumnarStore's key column is the single source of truth for row ordering, and chunked storage shows up only on the value side (typically post-concatSorted). If chunked keys ever land they'll widen this type the same wayPublicColumnForKindwidens for values.