pub struct SamplingConfig {
pub strategy: SamplingStrategy,
pub sample_size: usize,
pub seed: Option<u64>,
pub stratify_column: Option<String>,
}Expand description
Configuration for database table sampling
Fields§
§strategy: SamplingStrategySampling strategy to use
sample_size: usizeTarget sample size (number of rows)
seed: Option<u64>Random seed for reproducible sampling (optional)
stratify_column: Option<String>Whether to stratify sampling by a column (optional)
Implementations§
Source§impl SamplingConfig
impl SamplingConfig
Sourcepub fn quick_sample(sample_size: usize) -> Self
pub fn quick_sample(sample_size: usize) -> Self
Create a new sampling config for quick analysis
Sourcepub fn representative_sample(
sample_size: usize,
stratify_column: Option<String>,
) -> Self
pub fn representative_sample( sample_size: usize, stratify_column: Option<String>, ) -> Self
Create a config for representative sampling
Sourcepub fn temporal_sample(sample_size: usize, time_column: String) -> Self
pub fn temporal_sample(sample_size: usize, time_column: String) -> Self
Create a config for temporal data sampling
Sourcepub fn generate_sample_query(
&self,
base_query: &str,
total_rows: u64,
) -> Result<String, DataProfilerError>
pub fn generate_sample_query( &self, base_query: &str, total_rows: u64, ) -> Result<String, DataProfilerError>
Generate the appropriate SQL sampling query
Trait Implementations§
Source§impl Clone for SamplingConfig
impl Clone for SamplingConfig
Source§fn clone(&self) -> SamplingConfig
fn clone(&self) -> SamplingConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamplingConfig
impl Debug for SamplingConfig
Source§impl Default for SamplingConfig
impl Default for SamplingConfig
Source§impl<'de> Deserialize<'de> for SamplingConfig
impl<'de> Deserialize<'de> for SamplingConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SamplingConfig
impl RefUnwindSafe for SamplingConfig
impl Send for SamplingConfig
impl Sync for SamplingConfig
impl Unpin for SamplingConfig
impl UnsafeUnpin for SamplingConfig
impl UnwindSafe for SamplingConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more