Skip to main content

RowSignature

Struct RowSignature 

Source
pub struct RowSignature { /* private fields */ }
Expand description

Canonical encoding of one row, for duplicate detection.

Fields are length-prefixed so their boundaries are unambiguous: ["ab", "c"] and ["a", "bc"] must not sign alike. Trailing absent fields are then dropped, which makes the signature independent of how wide the schema had grown when the row was read. A JSON key discovered mid-stream appends a column, and without the trim every row that predates it signs one field shorter than an identical row read afterwards, so the two count as distinct and the duplicate total comes up silently short.

The trim is safe because an absent field and an explicitly empty one are the same null to this profiler: it collapses only rows that already hold equal values in every column they share. On a fixed schema it applies uniformly to every row, so it changes no count there.

Implementations§

Source§

impl RowSignature

Source

pub fn push_field(&mut self, value: &str)

Append one field. An absent field is the empty string, the same representation StreamingColumnCollection::process_record gives a missing trailing value and an Arrow null.

Only an exactly empty value counts as absent here, deliberately: the broader is_null_like_token rule that decides null_count also matches null, nan and whitespace, and trimming on it would collapse a row ending in one of those against a row that ends in no field at all, inventing a duplicate.

Source

pub fn finish(self) -> String

The signature, with trailing absent fields dropped.

Trait Implementations§

Source§

impl Debug for RowSignature

Source§

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

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

impl Default for RowSignature

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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