Skip to main content

WriterStatistics

Enum WriterStatistics 

Source
pub enum WriterStatistics {
    None,
    MinMax,
    Automatic,
}
Expand description

The block-local min/max statistics policy selected by a crate::Writer.

Statistics are written only for v0.2 logical types with a fixed canonical representation: booleans, numeric types, decimals, timestamps, dates, and fixed-width binary values. Variable-width strings and binary values have no v0.2 min/max representation and are left without statistics under either enabled policy. None is the default and preserves the writer’s historical byte output.

Under both enabled policies nulls and floating-point NaNs are ignored, a column left with no value has no statistic at all, and infinities are ordinary bounds. Floating-point bounds are numeric, so -0.0 and 0.0 are interchangeable as a bound; the writer keeps whichever bit pattern it saw first, which makes the choice deterministic without claiming that one encoding of zero is smaller than the other.

A pair costs twice its logical type’s canonical width and lives in the data frame header, which readers bound at 64 MiB. A fixed_binary column therefore charges twice its byte width against that budget, and a schema wide enough to exhaust it is refused by crate::Writer::append rather than written; such a schema can still be written with Self::None.

Variants§

§

None

Do not write optional column statistics.

§

MinMax

Write min/max statistics whenever a supported column has at least one non-null, non-NaN value.

This includes the primary timestamp column. Section 11 makes that repetition unnecessary, because the block header already carries the same bounds as the mandatory pruning statistic, but writing it anyway keeps this policy’s output a function of the schema alone and is what lets it override an Self::Automatic omission on any column.

§

Automatic

Write statistics only where a deterministic rule predicts that the header bytes are justified.

The rule is exactly this. A column gets a pair when it is not the primary timestamp column, whose block-header bounds are already the complete mandatory pruning statistic; and it has at least 64 non-null, non-NaN values; and its raw dense value bytes are at least eight times the pair. The last test binds only on bool, whose values cost one bit each, where it raises the effective floor to 121 values; for every other supported type the 64-value floor is the stricter of the two.

The decision reads only the block’s values and its schema. It does not depend on elapsed time, iteration order, randomness, earlier blocks, or how the rows were divided across crate::Writer::append calls, so equal block contents produce equal bytes.

Trait Implementations§

Source§

impl Clone for WriterStatistics

Source§

fn clone(&self) -> WriterStatistics

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 WriterStatistics

Source§

impl Debug for WriterStatistics

Source§

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

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

impl Default for WriterStatistics

Source§

fn default() -> WriterStatistics

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

impl Eq for WriterStatistics

Source§

impl PartialEq for WriterStatistics

Source§

fn eq(&self, other: &WriterStatistics) -> 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 WriterStatistics

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.