Expand description
Block compression for encoded column data (LZ4 and Zstd).
Each encoded column block can be optionally compressed after type-specific encoding. The compressed format prepends a codec tag and size header to enable deterministic decompression.
§Compressed block format (v2)
[codec_tag: u8] — 0x00=None, 0x01=Lz4, 0x02=Zstd
[compressed_size: u32]
[uncompressed_size: u32]
[compressed_data: compressed_size bytes]When compressed_size == 0, the block is stored uncompressed.
The codec tag enables deterministic dispatch — no trial decompression.
Constants§
- ZSTD_
HIGH_ LEVEL - Maximum Zstd compression level for cold-tier recompression.
Functions§
- compress_
block - Compress a block using LZ4.
- compress_
block_ with_ codec - Compress a block using the specified compression codec.
- compress_
block_ zstd - Compress a block using Zstd at a specific level.
- compress_
block_ zstd_ dict - Compress a block with a trained Zstd dictionary.
- decompress_
block - Decompress a block that was compressed with
compress_blockorcompress_block_with_codec. - decompress_
block_ with_ optional_ dict - Decompress a block, optionally using a Zstd dictionary for
CODEC_TAG_ZSTD_DICTblocks. - decompress_
block_ zstd_ dict - Decompress a block that was compressed with a Zstd dictionary.
- should_
skip_ compression - Returns
trueif the type-specific encoding already achieved enough compression that LZ4 should be skipped. - train_
zstd_ dictionary - Train a Zstd compression dictionary from a set of sample buffers.