pub enum WriterEncoding {
Raw,
Adaptive,
Fixed(WriterTransform),
}Expand description
The writer-side encoding policy.
Raw is the default and preserves the plain-layout, raw-transform stream
choices, so a file written without asking for anything else is byte-for-byte
what earlier versions of this writer produced. Adaptive profiles each dense
stream once and selects a specialized v0.2 layout only after the complete
stored representation — every stream, its descriptor, its padding, and its
compressed size — beats the raw baseline by at least the larger of 64 bytes
or one percent. Selection is deterministic and depends only on the block’s
values, never on how those rows were divided among crate::Writer::append
calls.
Fixed applies one requested transform or layout to every dense column
value stream. It prices nothing and never falls back:
crate::Writer::create returns an error for a transform this writer does
not offer for one of the schema’s logical types, and a block whose values
the transform cannot describe fails when it is published.
The offered set is exactly the candidate set Adaptive would have priced,
so a fixed file is always a shape adaptive could also have written. That set
is narrower than what the format permits: a timestamp64 column offers raw,
frame of reference, delta, and delta-of-delta and nothing else, so
Fixed(WriterTransform::Dictionary) is refused for one even though a
dictionary timestamp64 column is a legal v0.2 shape.
Validity streams stay raw under Fixed, because they are independent
boolean streams that the requested value transform does not describe.
Adaptive profiling holds the block’s dense values a second time while it
prices candidates, so it raises peak writer memory by a small multiple of
WriterOptions::byte_block_target. Lower that target to lower the peak.
Variants§
Raw
Plain layout with the raw transform for every stream.
Adaptive
Deterministically choose profitable v0.2 layouts and transforms.
Fixed(WriterTransform)
Apply one transform/layout to every compatible column without profiling.
Trait Implementations§
Source§impl Clone for WriterEncoding
impl Clone for WriterEncoding
Source§fn clone(&self) -> WriterEncoding
fn clone(&self) -> WriterEncoding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more