RLE
RLE stores runs of equal integers. It is codec id 3 in IntCol only.
Layout
Section titled “Layout”| Field | Encoding | Meaning |
|---|---|---|
| count | varint | n, the number of values |
| codec | u8 | 3 |
| values | Flat | one value per run |
| run ends | Flat | exclusive end index of each run, strictly increasing, the last equal to n |
Each Flat here has its own count, codec byte and body, see Column container types.
How to decode
Section titled “How to decode”- Read
count, the codec byte (3), the values Flat and the run ends Flat. - Run
rcovers indexes from the end of runr - 1(0 for the first run) up to, but not including,ends[r]. - Every index in the run gets
values[r].
Illustration
Section titled “Illustration”Derived by hand, not from a real file. Six values 7, 7, 7, 7, 9, 9 form two runs with values 7 and 9 and run ends 4 and 6.
06 03 count 6, codec RLE02 01 0E 02 08 values: Flat FOR, min 7, width 2, offsets 0 202 01 08 02 08 run ends: Flat FOR, min 4, width 2, offsets 0 2Decoded: 7, 7, 7, 7, 9, 9.
Checks
Section titled “Checks”- The values Flat and the run ends Flat have the same count.
- Run ends are strictly increasing and the last one equals
n.
When writers pick it
Section titled “When writers pick it”See How writers choose a codec.