Skip to main content

Crate packmem

Crate packmem 

Source
Expand description

packmem: adaptive, operation-aware in-memory encodings that are processed without decompression.

Re-exports§

pub use dynamic::Cell;
pub use dynamic::DynTable;
pub use dynamic::Num;
pub use dynamic::Pred;
pub use dynamic::StrMeasure;
pub use ints::Hint;
pub use ints::PackedInts;
pub use strs::PackedStrs;
pub use table::Column;
pub use table::Table;

Modules§

buf
A read-only array that either owns its values or borrows them from a shared block of bytes, such as a memory-mapped file. Packed columns hold their data in these, so a table can be opened without copying it.
csv
CSV and TSV straight into a DynTable, fed in chunks so a stream (a file, Postgres COPY ... TO STDOUT) never has to be held whole. RFC 4180 quoting: fields in double quotes may contain the delimiter, line breaks and "" for a quote.
dynamic
Mutable, schema-flexible table: append and update on top of packed chunks.
ints
Integer columns: a small vocabulary of composable lightweight encodings, chosen per column from a sample, each with operators that run on the encoded form.
strs
String columns: dictionary (predicates run once per distinct value) and/or FSST (per-string random access, equality on compressed bytes).
table
A table of packed columns built from flat records (JSON lines).
wire
Byte-level reader and writer for saving packed tables as they are, without re-encoding. Single integers (counts, lengths, chunk metadata) are LEB128 varints, signed ones zigzagged; a small table is mostly such headers, and fixed 8-byte fields made it larger than JSON after compression. Vectors and floats are little-endian at full width, and each vector’s data is padded to its element size, counted from the start of the output, so that a reader holding the bytes in aligned memory (a mapped file) can use the vector in place instead of copying it. Formats before 4 wrote every integer at full width; R::fixed reads those.
ztext
Stand-in for ztext in builds without Zstandard (WebAssembly, and anything built without the ztext feature). Text is never compressed that way here, and a file that was is refused with an explanation.