use std::fmt::Debug;
use vortex_array::vtable::VTable;
pub struct GenerateStatsOptions {
pub count_distinct_values: bool,
}
impl Default for GenerateStatsOptions {
fn default() -> Self {
Self {
count_distinct_values: true,
}
}
}
pub(crate) const SAMPLE_SIZE: u32 = 64;
pub(crate) const SAMPLE_COUNT: u32 = 16;
pub trait CompressorStats: Debug + Clone {
type ArrayVTable: VTable;
fn generate(input: &<Self::ArrayVTable as VTable>::Array) -> Self {
Self::generate_opts(input, GenerateStatsOptions::default())
}
fn generate_opts(
input: &<Self::ArrayVTable as VTable>::Array,
opts: GenerateStatsOptions,
) -> Self;
fn source(&self) -> &<Self::ArrayVTable as VTable>::Array;
fn sample(&self, sample_size: u32, sample_count: u32) -> Self {
self.sample_opts(sample_size, sample_count, GenerateStatsOptions::default())
}
fn sample_opts(&self, sample_size: u32, sample_count: u32, opts: GenerateStatsOptions) -> Self;
}