Bytes DICT
Bytes DICT stores each distinct byte string once and refers to it by index. It is codec id 1 in BytesCol. The integer version is Integer DICT.
Layout
Section titled “Layout”| Field | Encoding | Meaning |
|---|---|---|
| codec | u8 | 1 |
| dictionary | Plain | the distinct values, laid out as in Bytes PLAIN without its codec byte |
| indexes | Flat | one index into the dictionary per value |
The count of values is the count of the indexes Flat. See Column container types.
How to decode
Section titled “How to decode”- Read the codec byte (1), the dictionary
Plainand the indexes Flat. - Value
iis dictionary entryindexes[i].
Illustration
Section titled “Illustration”Derived by hand, not from a real file. The values x, y, x, x use the dictionary x, y and the indexes 0, 1, 0, 0.
01 codec DICT02 00 02 dictionary lens: IntCol, count 2, CONST 101 00 00 offset samples: Flat, count 1, CONST 002 78 79 total 2, bytes "x" "y"04 01 00 01 02 indexes: Flat FOR, min 0, width 1, bits 0 1 0 0Decoded: x, y, x, x.
Checks
Section titled “Checks”- Every index is below the number of dictionary entries.
- Everything that Bytes PLAIN checks for the dictionary.
When writers pick it
Section titled “When writers pick it”See How writers choose a codec.