Native protocol column types
See Data Types for general reference.
Tip
Numeric types encoding matches memory layout of little endian CPUs like AMD64 or ARM64, allowing very efficient encoding and decoding.
| Type | Encoding |
|---|---|
| Integers (Int/UInt) | 8, 16, 32, 64, 128 or 256 bits in little endian |
| Floats (Float32/Float64) | IEEE 754 binary representation |
| String | Array of strings as (len, value) |
| FixedString(N) | Array of N-byte sequences |
| IPv4 | Alias of UInt32, represented as UInt32 |
| IPv6 | Alias of FixedString(16), represented as binary |
| Tuple | Array of columns encoded continuously. Example: Tuple(String, UInt8) = two continuous columns |
| Map | Map(K, V) = three columns: Offsets ColUInt64, Keys K, Values V. Row count in Keys/Values = last Offsets value |
| Array | Array(T) = two columns: Offsets ColUInt64, Data T. Row count in Data = last Offsets value |
| Nullable | Nullable(T) = two columns: Nulls ColUInt8, Values T with same row count. Nulls is mask: 1=null, 0=value |
| UUID | Alias of FixedString(16), represented as binary |
| Enum | Alias of Int8 or Int16, each integer mapped to a String value |
| LowCardinality | LowCardinality(T) = two columns: Index T, Keys K where K is UInt8/16/32/64. Index contains unique values, Keys contains indexes into Index |
| Bool | Alias of UInt8: 0=false, 1=true |
Example: Nullable encoding
Example: LowCardinality encoding