pub struct ColumnProfile {
pub name: String,
pub data_type: DataType,
pub null_count: usize,
pub total_count: usize,
pub unique_count: Option<usize>,
pub unique_count_is_approximate: Option<bool>,
pub unique_count_lower_bound: Option<usize>,
pub invalid_count: Option<usize>,
pub type_homogeneity: Option<TypeHomogeneity>,
pub locale_number_count: Option<usize>,
pub stats: ColumnStats,
pub patterns: Option<Vec<Pattern>>,
}Expand description
Profiling statistics for a single column.
Fields§
§name: String§data_type: DataType§null_count: usize§total_count: usize§unique_count: Option<usize>§unique_count_is_approximate: Option<bool>Whether unique_count is an approximate (HyperLogLog) estimate rather
than an exact distinct count.
None when unique_count is None (never computed); Some(false) for
an exact count; Some(true) once the cardinality estimator has spilled
to its HLL sketch (~1% relative error). Consumers running key or
high-cardinality/uniqueness gates must treat Some(true) as “do not rely
on this as an exact integer” – an exact-looking count with no provenance
is unsafe for those checks.
unique_count_lower_bound: Option<usize>A distinct count the column is certain to reach when unique_count is
an estimate: the distinct values the exact set held when it was
dropped. None when no floor was recorded, which includes every exact
count (the count is its own floor) and every report read back from a
document.
Not serialized: it exists so quality bounds computed during the run can bound a key column’s uniqueness with certainty (#819). A saved report keeps the bounds themselves.
invalid_count: Option<usize>Non-null values that failed the column type’s raw validity predicate: non-finite or malformed numbers on numeric columns, and values that do not parse directly as calendar dates on date columns. The date predicate intentionally does not trim surrounding whitespace; descriptive date statistics may normalize whitespace independently.
For numeric columns, mean/std_dev cover
total_count - null_count - invalid_count values. For date columns,
this count audits the strict raw-value quality predicate. None means
the check did not run (another column type, or statistics skipped) —
never “no invalid values”, which is Some(0).
type_homogeneity: Option<TypeHomogeneity>How the column’s non-null values distribute across lexical classes.
data_type cannot answer “did this column have a dominant form?”: a
column of names and a column that is 60% numbers are both String, and
invalid_count is absent on string columns by contract. This carries the
evidence, so a consumer can tell a textual column from one that defeated
type inference.
Counted over the values the profiler retained — the engine’s bounded
reservoir sample on a large source, the whole column on a small or
in-memory one. classified_count() against total_count - null_count
is what says which happened; treat the shares as sampled whenever it is
short.
None means the classification did not run, never “one uniform class”:
a column that was classified and had nothing to classify (all-null, or
zero rows) is Some with every count zero.
locale_number_count: Option<usize>Of the values type_homogeneity counted as text, how many are
numbers written with a decimal comma or with digit-group separators:
10,50, 1.234,56, 1,234.56, 1'234.56, 1 234,56 (#433).
dataprof does not parse these as numbers, so they are in no numeric
statistic: a column of them is typed string, and a numeric column
counts them in invalid_count. The count does not say which
convention they follow; 1,234 is a thousand in one and a fraction in
another.
Counted over the same values as type_homogeneity, and present
whenever it is. None means the count did not run, including a report
written before dataprof recorded it; Some(0) means none were found.
stats: ColumnStats§patterns: Option<Vec<Pattern>>Detected patterns, or None when pattern detection did not run.
None and Some(vec![]) are not interchangeable: the former means the
column was never scanned, the latter that it was scanned and nothing
matched. Consumers that gate on sensitivity – redaction, agent-facing
output – must treat None as “unknown”, never as “no sensitive data”.
Trait Implementations§
Source§impl Clone for ColumnProfile
impl Clone for ColumnProfile
Source§fn clone(&self) -> ColumnProfile
fn clone(&self) -> ColumnProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ColumnProfile
impl Debug for ColumnProfile
Source§impl<'de> Deserialize<'de> for ColumnProfile
impl<'de> Deserialize<'de> for ColumnProfile
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnProfile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColumnProfile, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ColumnProfile
impl JsonSchema for ColumnProfile
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for ColumnProfile
impl Serialize for ColumnProfile
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ColumnProfile
impl RefUnwindSafe for ColumnProfile
impl Send for ColumnProfile
impl Sync for ColumnProfile
impl Unpin for ColumnProfile
impl UnsafeUnpin for ColumnProfile
impl UnwindSafe for ColumnProfile
Blanket Implementations§
impl<T> Allocation for T
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
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more