pub struct AdaptiveSelector {
pub sample_size: usize,
}Expand description
Adaptive encoding selector.
Uses stratified sampling: divides the column into NUM_STRATA
equal segments and samples sample_size / NUM_STRATA values from the
start of each segment. This captures data characteristics across the
entire column, not just the leading values.
Fields§
§sample_size: usizeTotal number of values to sample (spread across strata).
Implementations§
Source§impl AdaptiveSelector
impl AdaptiveSelector
Sourcepub fn analyze_floats(&self, values: &[f64]) -> FloatPattern
pub fn analyze_floats(&self, values: &[f64]) -> FloatPattern
Analyze a float column sample and determine the best encoding.
Sourcepub fn analyze_strings(&self, values: &[&str]) -> StringPattern
pub fn analyze_strings(&self, values: &[&str]) -> StringPattern
Analyze a string column sample and determine the best encoding.
Sourcepub fn analyze_integers(&self, values: &[i64]) -> IntegerPattern
pub fn analyze_integers(&self, values: &[i64]) -> IntegerPattern
Analyze an integer column sample and determine the best encoding.
Sourcepub fn encode_f64_adaptive(&self, values: &[f64]) -> Result<EncodedBlock>
pub fn encode_f64_adaptive(&self, values: &[f64]) -> Result<EncodedBlock>
Encode a float column with adaptive selection.
Uses sample-based trial encoding: trial-encodes only a stratified sample with each candidate encoder to pick the winner, then encodes the full column exactly once with the best encoder.
§Errors
Returns an error if encoding fails or the input is empty.
Sourcepub fn encode_string_adaptive(&self, values: &[&str]) -> Result<EncodedBlock>
pub fn encode_string_adaptive(&self, values: &[&str]) -> Result<EncodedBlock>
Encode a string column with adaptive selection.
§Errors
Returns an error if encoding fails or the input is empty.
Trait Implementations§
Source§impl Clone for AdaptiveSelector
impl Clone for AdaptiveSelector
Source§fn clone(&self) -> AdaptiveSelector
fn clone(&self) -> AdaptiveSelector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more