parquet::bloom_filter

Struct Sbbf

Source
pub struct Sbbf(Vec<Block>);
Expand description

A split block Bloom filter.

The creation of this structure is based on the crate::file::properties::BloomFilterProperties struct set via crate::file::properties::WriterProperties and is thus hidden by default.

Tuple Fields§

§0: Vec<Block>

Implementations§

Source§

impl Sbbf

Source

pub(crate) fn new_with_ndv_fpp(ndv: u64, fpp: f64) -> Result<Self, ParquetError>

Create a new Sbbf with given number of distinct values and false positive probability. Will return an error if fpp is greater than or equal to 1.0 or less than 0.0.

Source

pub(crate) fn new_with_num_of_bytes(num_bytes: usize) -> Self

Create a new Sbbf with given number of bytes, the exact number of bytes will be adjusted to the next power of two bounded by BITSET_MIN_LENGTH and BITSET_MAX_LENGTH.

Source

pub(crate) fn new(bitset: &[u8]) -> Self

Source

pub(crate) fn write<W: Write>(&self, writer: W) -> Result<(), ParquetError>

Write the bloom filter data (header and then bitset) to the output. This doesn’t flush the writer in order to boost performance of bulk writing all blocks. Caller must remember to flush the writer.

Source

fn write_bitset<W: Write>(&self, writer: W) -> Result<(), ParquetError>

Write the bitset in serialized form to the writer.

Source

fn header(&self) -> BloomFilterHeader

Create and populate BloomFilterHeader from this bitset for writing to serialized form

Source

pub(crate) fn read_from_column_chunk<R: ChunkReader>( column_metadata: &ColumnChunkMetaData, reader: Arc<R>, ) -> Result<Option<Self>, ParquetError>

Read a new bloom filter from the given offset in the given reader.

Source

fn hash_to_block_index(&self, hash: u64) -> usize

Source

pub fn insert<T: AsBytes + ?Sized>(&mut self, value: &T)

Insert an AsBytes value into the filter

Source

fn insert_hash(&mut self, hash: u64)

Insert a hash into the filter

Source

pub fn check<T: AsBytes>(&self, value: &T) -> bool

Check if an AsBytes value is probably present or definitely absent in the filter

Source

fn check_hash(&self, hash: u64) -> bool

Check if a hash is in the filter. May return true for values that was never inserted (“false positive”) but will always return false if a hash has not been inserted.

Source

pub(crate) fn estimated_memory_size(&self) -> usize

Return the total in memory size of this bloom filter in bytes

Trait Implementations§

Source§

impl Clone for Sbbf

Source§

fn clone(&self) -> Sbbf

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Sbbf

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Sbbf

§

impl RefUnwindSafe for Sbbf

§

impl Send for Sbbf

§

impl Sync for Sbbf

§

impl Unpin for Sbbf

§

impl UnwindSafe for Sbbf

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

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

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T