Encodings

Encoding turns a sequence of typed values into a byte stream before compression. The Chunk Header records the selected codec in encoding_type. This field describes values in a Value or non-aligned Chunk, and timestamps in an aligned Time Chunk.

ValueName
0PLAIN
1DICTIONARY
2RLE
3DIFF
4TS_2DIFF
5BITMAP
6GORILLA_V1
7REGULAR
8GORILLA
9ZIGZAG
10FREQ (deprecated)
11CHIMP
12SPRINTZ
13RLBE
14CAMEL

The following combinations are supported by the reference value encoders. An assigned codec number does not mean that every data type can use it:

Data typeAvailable encodings
BOOLEANPLAIN, RLE
INT32, INT64, TIMESTAMP, DATEPLAIN, RLE, TS_2DIFF, GORILLA, ZIGZAG, CHIMP, SPRINTZ, RLBE
FLOATPLAIN, RLE, TS_2DIFF, GORILLA_V1, GORILLA, CHIMP, SPRINTZ, RLBE
DOUBLEPLAIN, RLE, TS_2DIFF, GORILLA_V1, GORILLA, CHIMP, SPRINTZ, RLBE, CAMEL
TEXT, STRINGPLAIN, DICTIONARY
BLOB, OBJECTPLAIN

Encoding Families

The identifiers describe different ways to transform a logical sequence into bytes. They are wire format identifiers, not implementation-specific enumeration ordinals.

FamilyEncodingsData property typically exploited
LiteralPLAINNo prediction; values are serialized independently
DictionaryDICTIONARYRepeated binary values are replaced by dictionary references
Run length / bit packingRLE, RLBERepeated values or small bit widths
Delta and predictionDIFF, TS_2DIFF, REGULAR, SPRINTZSmall or regular changes between adjacent values
Integer remappingZIGZAGSmall signed integers represented as small unsigned integers
XOR-basedGORILLA_V1, GORILLA, CHIMP, CAMELStable leading and trailing bits between adjacent floating-point values
Legacy or specializedBITMAP, FREQReserved historical layouts; FREQ is deprecated

Different distributions favor different encodings. Whatever the writer chooses, the reader selects a decoder from the pair (data_type, encoding_type).

Plain Encoding

A PLAIN stream does not store an element count. The Page context, time stream, or null bitmap determines the number of elements. Values are written consecutively:

Data typeEncoding of one value
BOOLEAN0x00 or 0x01
INT32, DATEVarInt
INT64, TIMESTAMPBig-endian int64
FLOATBig-endian float32
DOUBLEBig-endian float64
TEXT, STRING, BLOB, OBJECTVarInt byte_length + raw bytes

The length of a PLAIN binary value is non-negative. A non-aligned value stream does not contain nulls; the Value Page bitmap represents nulls in an aligned value stream.

The other encoding identifiers select their respective value-stream bit layouts. A reader cannot decode an unknown encoding as PLAIN.

Decoder Contract

A decoder's state lasts for one Page stream. After decryption and decompression, select the codec, decode within the stream boundary, and check that the number of values matches the Page context. Start with fresh decoding state for the next Page.

For aligned data, the Time Chunk Header names the time codec; an aligned Value Page decodes one value for each set bitmap bit. For non-aligned data, the Chunk Header names only the value codec. Its time codec comes from shared configuration, defaulting to TS_2DIFF; there is no serialized time_encoder footer field. See Configurations.

An unsupported encoding prevents value decoding. A scanner that parses the raw Header fields can still locate the next Chunk using data_size, even if a higher-level codec registry rejects the identifier. It must not substitute PLAIN or another decoder.