Skip to content

Integer DICT stores each distinct value once and then refers to it by index. It is codec id 4 in IntCol only. The byte version is Bytes DICT.

Field Encoding Meaning
count varint n, the number of values
codec u8 4
dictionary Flat the distinct values, sorted
indexes Flat n indexes into the dictionary

Each Flat here has its own count, codec byte and body, see Column container types.

  1. Read count, the codec byte (4), the dictionary Flat and the indexes Flat.
  2. Value i is dictionary[indexes[i]].

Derived by hand, not from a real file. The values 20, 20, 5, 20, 5 have the sorted distinct values 5, 20 and the indexes 1, 1, 0, 1, 0.

05 04 count 5, codec DICT
02 01 0A 04 F0 dictionary: Flat FOR, min 5, width 4, offsets 0 15
05 01 00 01 0B indexes: Flat FOR, min 0, width 1, bits 1 1 0 1 0

Decoded: 20, 20, 5, 20, 5.

  • The indexes Flat has n values.
  • Every index is below the dictionary length.

See How writers choose a codec.