pub struct SchemaFingerprint {
pub schema_hash: [u8; 32],
pub field_stats: Vec<FieldStats>,
pub record_count: u64,
pub created_at: u64,
}Expand description
Fingerprint that identifies a schema structure plus its data distribution.
Two SchemaFingerprints with equal schema_hash are structurally identical
(same field names and kinds, regardless of order). The field_stats carry
distribution information used by the nearest-neighbor warm-start heuristic.
Fields§
§schema_hash: [u8; 32]SHA-256 of sorted (name, kind) pairs, stable across field-ordering.
field_stats: Vec<FieldStats>One entry per schema field; empty when built with Self::from_schema.
record_count: u64Number of records in the sample; 0 when built with Self::from_schema.
created_at: u64Unix timestamp (seconds) when this fingerprint was created.
Implementations§
Source§impl SchemaFingerprint
impl SchemaFingerprint
Sourcepub fn from_schema(schema: &Schema) -> Self
pub fn from_schema(schema: &Schema) -> Self
Build a structure-only fingerprint from a schema definition.
field_stats is populated with zero-value statistics for each field so
that the Jaccard similarity computation in crate::similarity can
always access the field names and kinds, even without sample data.
Sourcepub fn from_schema_with_mappings(
schema: &Schema,
mappings: &[FieldMapping],
) -> Self
pub fn from_schema_with_mappings( schema: &Schema, mappings: &[FieldMapping], ) -> Self
Like Self::from_schema but includes cross-schema mappings in the hash
so warm-start artifacts from same-schema runs are never reused.
Sourcepub fn from_sample(schema: &Schema, records: &[Record]) -> Self
pub fn from_sample(schema: &Schema, records: &[Record]) -> Self
Build a full fingerprint from a schema and a sample of records.
50–100 records per field is typically enough for reliable statistics.
The schema_hash is identical to what Self::from_schema would produce for
the same schema, so exact-hash lookups still work.
Sourcepub fn from_sample_with_mappings(
schema: &Schema,
records: &[Record],
mappings: &[FieldMapping],
) -> Self
pub fn from_sample_with_mappings( schema: &Schema, records: &[Record], mappings: &[FieldMapping], ) -> Self
Like Self::from_sample but includes cross-schema mappings in the hash.
Trait Implementations§
Source§impl Clone for SchemaFingerprint
impl Clone for SchemaFingerprint
Source§fn clone(&self) -> SchemaFingerprint
fn clone(&self) -> SchemaFingerprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more