pub struct ColumnStatistics {
pub null_fraction: f64,
pub distinct_count: u64,
pub min_value: Option<Value>,
pub max_value: Option<Value>,
pub avg_column_width: Option<u32>,
pub histogram: Option<Vec<Value>>,
}Expand description
Statistics describing a single column.
Every field defaults to a neutral value so a partially populated
record (e.g. a provider that only knows null_fraction) is still
valid. min_value, max_value, and histogram use
serde_json::Value because a column can hold any SQL type.
§Examples
use vlorql_core::statistics::ColumnStatistics;
use serde_json::json;
let stats = ColumnStatistics {
null_fraction: 0.1,
distinct_count: 1_000,
min_value: Some(json!(1)),
max_value: Some(json!(9_999)),
avg_column_width: Some(4),
histogram: None,
};
assert_eq!(stats.distinct_count, 1_000);Fields§
§null_fraction: f64Fraction of rows whose value is NULL, in the range 0.0..=1.0.
distinct_count: u64Estimated number of distinct (non-null) values in the column.
min_value: Option<Value>Smallest observed value, if known.
max_value: Option<Value>Largest observed value, if known.
avg_column_width: Option<u32>Average width of a stored value in bytes, if known.
histogram: Option<Vec<Value>>Optional equi-depth histogram bucket boundaries.
Trait Implementations§
Source§impl Clone for ColumnStatistics
impl Clone for ColumnStatistics
Source§fn clone(&self) -> ColumnStatistics
fn clone(&self) -> ColumnStatistics
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 ColumnStatistics
impl Debug for ColumnStatistics
Source§impl Default for ColumnStatistics
impl Default for ColumnStatistics
Source§fn default() -> ColumnStatistics
fn default() -> ColumnStatistics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ColumnStatisticswhere
ColumnStatistics: Default,
impl<'de> Deserialize<'de> for ColumnStatisticswhere
ColumnStatistics: Default,
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
Source§impl PartialEq for ColumnStatistics
impl PartialEq for ColumnStatistics
Source§impl Serialize for ColumnStatistics
impl Serialize for ColumnStatistics
impl StructuralPartialEq for ColumnStatistics
Auto Trait Implementations§
impl Freeze for ColumnStatistics
impl RefUnwindSafe for ColumnStatistics
impl Send for ColumnStatistics
impl Sync for ColumnStatistics
impl Unpin for ColumnStatistics
impl UnsafeUnpin for ColumnStatistics
impl UnwindSafe for ColumnStatistics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request