A Vortex scalar is a typed single value — the runtime analog of aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vortex-data/vortex/llms.txt
Use this file to discover all available pages before exploring further.
DType. Scalars appear in statistics (min, max, sum stored per array), in expression literals, and in any other context where a single typed value must be serialized. Scalars are serialized using Protocol Buffers via the vortex.scalar package.
Wire format
The top-levelScalar message pairs a DType with a ScalarValue, making every serialized scalar self-describing:
ScalarValue
ScalarValue is a oneof that covers every value kind supported by the Vortex type system:
Value kinds by DType
DType | ScalarValue field | Notes |
|---|---|---|
Null | null_value | google.protobuf.NullValue (always NULL_VALUE = 0) |
Bool | bool_value | Proto native bool |
Primitive (unsigned int) | uint64_value | All unsigned integers widened to uint64 |
Primitive (signed int) | int64_value | All signed integers widened to sint64 (zigzag-encoded) |
Primitive (F16) | f16_value | Raw bit pattern stored as uint64 |
Primitive (F32) | f32_value | Proto native float |
Primitive (F64) | f64_value | Proto native double |
Utf8 | string_value | Proto native string (UTF-8) |
Binary | bytes_value | Proto native bytes |
List / FixedSizeList / Struct_ | list_value | Recursive ListValue of child ScalarValues |
Variant | variant_value | Nested Scalar with its own embedded DType |
Decimal | int64_value | Unscaled integer value as sint64 |
| Null scalar (any nullable type) | null_value | null_value may appear for any nullable DType |
F16 values are stored as a
uint64 containing the raw 16-bit IEEE 754 bit pattern. The DType field of the enclosing Scalar indicates that interpretation is as F16.Null handling
A scalar is null whenScalarValue.kind is set to null_value. The DType of the enclosing Scalar still identifies the type; nullability is carried by the nullable field of the DType (see DType Serialization Format).
A ScalarValue with no kind set (the proto default, field number 0) is also treated as null.
Scalars in statistics
Array statistics are stored as serializedScalar bytes inside the ArrayStats FlatBuffer table. Each statistics field that holds a scalar (min, max, sum) stores a proto-serialized ScalarValue byte slice:
Precision enum distinguishes between statistics that are exact (e.g., computed directly from data) and those that are inexact (e.g., propagated through a lossy encoding). The DType for the statistics values is inferred from the array’s own DType; it is not re-encoded inside each [ubyte] field.
Scalars in expressions
Expressions use thevortex.expr.LiteralOpts proto message to embed scalar values:
id = "vortex.literal" and serializes its LiteralOpts into the Expr.metadata field as proto bytes. The full Scalar message (with embedded DType) is stored, making literal expressions self-describing regardless of the surrounding expression context.
Variant scalars
TheVariant scalar kind supports semi-structured data where each row may carry a value of a different type. A Variant scalar is represented as a nested Scalar message:
Scalar includes its own DType, allowing each variant value to be independently typed. See RFC 0015 for the full specification of the Variant type.