Home

Awesome

Zst Blocks format

The zst blocks format is a simple format for storing rows of data in a compressed format. Compression is done using zstandard (zstd).

If you're just interested in using the CLI or the python scripts, see here.

Format

A file is made up of a series of blocks. Each block is independent and can be decoded without any information from other blocks.

struct ZstCompressedBlock {
	uint32 compressed_size;
	byte compressed_data[compressed_size];
};

The decompressed data has the following format:

struct ZstBlock {
	uint32 row_count;
	ZstRowInfo row_infos[row_count];
	byte rows_data[];
};

struct ZstRowInfo {
	uint32 offset;
	uint32 size;
};

The offset is relative to the start of the rows_data field.

All fields are little endian.

Comparison to plain zstd

Pros

Cons