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 invalid_count: Option<usize>,
pub type_homogeneity: Option<TypeHomogeneity>,
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.
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.
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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 more