Column container types
A columnar block stores each stream inside a container. The container starts with a codec id byte and a count, then the codec’s body. There are four containers. Flat and IntCol hold integers, FloatCol holds 64-bit floats and BytesCol holds byte strings.
All four are self-describing and byte-aligned. In the tables below n is the number of values the stream is expected to hold.
Flat (n)
Section titled “Flat (n)”| Field | Encoding | Meaning |
|---|---|---|
| count | varint | number of values |
| codec | u8 | 0 CONST, 1 FOR or 5 PATCHED |
| body | per codec | see the codec page |
Flat is the small container. It holds the integers that DELTA, RLE and Integer DICT keep inside themselves (samples, deltas, run ends, dictionary and indexes), and the exception lists of PATCHED and ALP.
| Codec | Name | Page |
|---|---|---|
| 0 | CONST | CONST |
| 1 | FOR | FOR |
| 5 | PATCHED | PATCHED |
IntCol (n)
Section titled “IntCol (n)”| Field | Encoding | Meaning |
|---|---|---|
| count | varint | number of values |
| codec | u8 | 0, 1, 2, 3, 4 or 5 |
| body | per codec | see the codec page |
Codecs 0, 1 and 5 are the same as in Flat. The others are:
| Codec | Name | Page |
|---|---|---|
| 2 | DELTA | DELTA |
| 3 | RLE | RLE |
| 4 | DICT | Integer DICT |
A columnar block uses IntCol for the row tags, the integer cells, the boolean cells, and the integer streams of typed keys.
FloatCol
Section titled “FloatCol”| Field | Encoding | Meaning |
|---|---|---|
| codec | u8 | 0 RAW, 1 ALP or 2 XOR |
| body | per codec | see the codec page |
FloatCol writes the codec id before the count. This is the one container where the order is reversed: Flat and IntCol write count then codec, FloatCol writes codec then the body. For codec 0 the count is the first field of the body (count ‖ count × f64 bits). For codec 2 the count is the count of the IntCol the body holds.
| Codec | Name | Page |
|---|---|---|
| 0 | RAW | Float RAW |
| 1 | ALP | ALP |
| 2 | XOR | XOR |
BytesCol
Section titled “BytesCol”| Field | Encoding | Meaning |
|---|---|---|
| codec | u8 | 0 PLAIN, 1 DICT, 2 FRONT or 3 FSST |
| body | per codec | see the codec page |
BytesCol also starts with the codec. It has no count of its own: PLAIN and FSST take it from the lengths IntCol, FRONT from the shared-prefix IntCol, and DICT from the indexes Flat (the dictionary has its own, different count).
| Codec | Name | Page |
|---|---|---|
| 0 | PLAIN | Bytes PLAIN |
| 1 | DICT | Bytes DICT |
| 2 | FRONT | FRONT |
| 3 | FSST | FSST |
Plain, the body of codec 0, is also used as a building block by codecs 1, 2 and 3.
Checks
Section titled “Checks”- An unknown codec id for the container is
Corrupt. - Counts are checked against their limit, see Count limit.
- The whole block must be consumed exactly, see the columnar limits.
Related
Section titled “Related”- Column codecs overview
- Packed integers
- Column slot and value modes
- Columnar block