Skip to main content

ColumnProfile

Struct ColumnProfile 

Source
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

Source§

fn clone(&self) -> ColumnProfile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ColumnProfile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ColumnProfile

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ColumnProfile, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for ColumnProfile

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for ColumnProfile

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more