Skip to content

RLE stores runs of equal integers. It is codec id 3 in IntCol only.

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.

  1. Read count, the codec byte (3), the values Flat and the run ends Flat.
  2. Run r covers indexes from the end of run r - 1 (0 for the first run) up to, but not including, ends[r].
  3. Every index in the run gets values[r].

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 RLE
02 01 0E 02 08 values: Flat FOR, min 7, width 2, offsets 0 2
02 01 08 02 08 run ends: Flat FOR, min 4, width 2, offsets 0 2

Decoded: 7, 7, 7, 7, 9, 9.

  • The values Flat and the run ends Flat have the same count.
  • Run ends are strictly increasing and the last one equals n.

See How writers choose a codec.