Nullable component values
sxs stores observations in ClickHouse, where every component becomes a column. Whether that column can hold a NULL is decided per component — and getting it right matters, because nullable columns are both restricted and expensive.
Principle
ClickHouse imposes two constraints that shape the mapping:
Nullableis not allowed insideArraytypes — array elements cannot beNullable.Nullablecolumns cost extra storage and slow down scans.
So sxs makes a column nullable only when it must, based on the component type
and — for a few types — on whether the loaded data actually contains empty/null
values. That last part is computed at load time: when data is ingested, sxs
looks at each component's values and records hasNull (a blank or missing value
counts as null) and count.
Mandatory components are always NOT NULL.
What it means for your data
- Measures can be null — a missing observation value is stored as NULL.
- Dimensions and the time dimension are never null — they are part of the observation key and must be present.
- Strings never store NULL: a missing or empty string is stored as
''. Reading it back gives an empty value, not null. - Numeric attributes are always nullable, because a number has no natural "empty" representation.
- Arrays never contain NULLs (ClickHouse forbids it).
- Mandatory components reject nulls: loading a blank value for a mandatory
component fails with
Invalid null value for mandatory component.
See also
- Dictionaries —
LowCardinalityand value encodings. - Unlisted Components — components with no enumeration.
- Output formats — how values are rendered on the way out.
- API — attributes and detail options.
