pub trait Statistics {
// Required methods
fn get(&self, stat: Stat) -> Option<Precision<ScalarValue>>;
fn to_set(&self) -> StatsSet;
fn set(&self, stat: Stat, value: Precision<ScalarValue>);
fn clear(&self, stat: Stat);
fn compute(&self, stat: Stat) -> Option<ScalarValue>;
fn retain_only(&self, stats: &[Stat]);
// Provided method
fn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet> { ... }
}Required Methods§
Sourcefn get(&self, stat: Stat) -> Option<Precision<ScalarValue>>
fn get(&self, stat: Stat) -> Option<Precision<ScalarValue>>
Returns the value of the statistic only if it’s present
Sourcefn set(&self, stat: Stat, value: Precision<ScalarValue>)
fn set(&self, stat: Stat, value: Precision<ScalarValue>)
Set the value of the statistic
Sourcefn compute(&self, stat: Stat) -> Option<ScalarValue>
fn compute(&self, stat: Stat) -> Option<ScalarValue>
Computes the value of the stat if it’s not present and inexact.
Returns the scalar if compute succeeded, or None if the stat is not supported
for this array.
fn retain_only(&self, stats: &[Stat])
Provided Methods§
Sourcefn compute_all(&self, stats: &[Stat]) -> VortexResult<StatsSet>
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 + '_
impl dyn Statistics + '_
Sourcepub fn get_as<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>(
&self,
stat: Stat,
) -> Option<Precision<U>>
pub fn get_as<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>( &self, stat: Stat, ) -> Option<Precision<U>>
Get the provided stat if present in the underlying array, converting the ScalarValue into a typed value.
If the stored ScalarValue is of different type then the primitive typed value this function will perform a cast.
§Panics
This function will panic if the conversion fails.
pub fn get_as_bound<S, U>(&self) -> Option<S::Bound>
Sourcepub fn compute_as<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>(
&self,
stat: Stat,
) -> Option<U>
pub fn compute_as<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>( &self, stat: Stat, ) -> Option<U>
Get or calculate the provided stat, converting the ScalarValue into a typed value.
If the stored ScalarValue is of different type then the primitive typed value this function will perform a cast.
§Panics
This function will panic if the conversion fails.
Sourcepub fn compute_min<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>(
&self,
) -> Option<U>
pub fn compute_min<U: for<'a> TryFrom<&'a ScalarValue, 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.
Sourcepub fn compute_max<U: for<'a> TryFrom<&'a ScalarValue, Error = VortexError>>(
&self,
) -> Option<U>
pub fn compute_max<U: for<'a> TryFrom<&'a ScalarValue, 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.
pub fn compute_is_strict_sorted(&self) -> Option<bool>
pub fn compute_is_sorted(&self) -> Option<bool>
pub fn compute_is_constant(&self) -> Option<bool>
pub fn compute_true_count(&self) -> Option<usize>
pub fn compute_null_count(&self) -> Option<usize>
pub fn compute_run_count(&self) -> Option<usize>
pub fn compute_bit_width_freq(&self) -> Option<Vec<usize>>
pub fn compute_trailing_zero_freq(&self) -> Option<Vec<usize>>
pub fn compute_uncompressed_size_in_bytes(&self) -> Option<usize>
Trait Implementations§
Source§impl WriteFlatBuffer for &dyn Statistics
impl WriteFlatBuffer for &dyn Statistics
Source§fn write_flatbuffer<'fb>(
&self,
fbb: &mut FlatBufferBuilder<'fb>,
) -> WIPOffset<Self::Target<'fb>>
fn write_flatbuffer<'fb>( &self, fbb: &mut FlatBufferBuilder<'fb>, ) -> WIPOffset<Self::Target<'fb>>
All statistics written must be exact