Skip to main content

WriterEncoding

Enum WriterEncoding 

Source
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

Source§

fn clone(&self) -> WriterEncoding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WriterEncoding

Source§

impl Debug for WriterEncoding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WriterEncoding

Source§

fn default() -> WriterEncoding

Returns the “default value” for a type. Read more
Source§

impl Eq for WriterEncoding

Source§

impl PartialEq for WriterEncoding

Source§

fn eq(&self, other: &WriterEncoding) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WriterEncoding

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.