lance_encoding::encoder

Trait BlockCompressor

Source
pub trait BlockCompressor:
    Debug
    + Send
    + Sync {
    // Required method
    fn compress(&self, data: DataBlock) -> Result<LanceBuffer>;
}
Expand description

Trait for compression algorithms that compress an entire block of data into one opaque and self-described chunk.

This is the most general type of compression. There are no constraints on the method of compression it is assumed that the entire block of data will be present at decompression.

This is the least appropriate strategy for random access because we must load the entire block to access any single value. This should only be used for cases where random access is never required (e.g. when encoding metadata buffers like a dictionary or for encoding rep/def mini-block chunks)

Required Methods§

Source

fn compress(&self, data: DataBlock) -> Result<LanceBuffer>

Compress the data into a single buffer

Also returns a description of the compression that can be used to decompress when reading the data back

Implementors§