Trait vortex_array::stats::Statistics

source ·
pub trait Statistics {
    // Required methods
    fn get(&self, stat: Stat) -> Option<Scalar>;
    fn to_set(&self) -> StatsSet;
    fn set(&self, stat: Stat, value: Scalar);
    fn clear(&self, stat: Stat);
    fn compute(&self, stat: Stat) -> Option<Scalar>;
    fn retain_only(&self, stats: &[Stat]);

    // Provided method
    fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet> { ... }
}

Required Methods§

source

fn get(&self, stat: Stat) -> Option<Scalar>

Returns the value of the statistic only if it’s present

source

fn to_set(&self) -> StatsSet

Get all existing statistics

source

fn set(&self, stat: Stat, value: Scalar)

Set the value of the statistic

source

fn clear(&self, stat: Stat)

Clear the value of the statistic

source

fn compute(&self, stat: Stat) -> Option<Scalar>

Computes the value of the stat if it’s not present.

Returns the scalar if compute succeeded, or None if the stat is not supported for this array.

source

fn retain_only(&self, stats: &[Stat])

Provided Methods§

source

fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>

Compute all the requested statistics (if not already present) Returns a StatsSet with the requested stats and any additional available stats

Implementations§

source§

impl dyn Statistics + '_

source

pub fn get_as<U: for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, stat: Stat, ) -> Option<U>

source

pub fn get_as_cast<U: NativePType + for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, stat: Stat, ) -> Option<U>

source

pub fn compute_as<U: for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, stat: Stat, ) -> Option<U>

Get or calculate the provided stat, converting the Scalar into a typed value.

This function will panic if the conversion fails.

source

pub fn compute_as_cast<U: NativePType + for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, stat: Stat, ) -> Option<U>

source

pub fn compute_min<U: for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, ) -> Option<U>

Get or calculate the minimum value in the array, returning as a typed value.

This function will panic if the conversion fails.

source

pub fn compute_max<U: for<'a> TryFrom<&'a Scalar, Error = VortexError>>( &self, ) -> Option<U>

Get or calculate the maximum value in the array, returning as a typed value.

This function will panic if the conversion fails.

source

pub fn compute_is_strict_sorted(&self) -> Option<bool>

source

pub fn compute_is_sorted(&self) -> Option<bool>

source

pub fn compute_is_constant(&self) -> Option<bool>

source

pub fn compute_true_count(&self) -> Option<usize>

source

pub fn compute_null_count(&self) -> Option<usize>

source

pub fn compute_run_count(&self) -> Option<usize>

source

pub fn compute_bit_width_freq(&self) -> Option<Vec<usize>>

source

pub fn compute_trailing_zero_freq(&self) -> Option<Vec<usize>>

source

pub fn compute_uncompressed_size_in_bytes(&self) -> Option<usize>

Trait Implementations§

source§

impl WriteFlatBuffer for &dyn Statistics

source§

type Target<'t> = ArrayStats<'t>

source§

fn write_flatbuffer<'fb>( &self, fbb: &mut FlatBufferBuilder<'fb>, ) -> WIPOffset<Self::Target<'fb>>

Implementors§