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
impl Sbbf
Sourcepub(crate) fn new_with_ndv_fpp(ndv: u64, fpp: f64) -> Result<Self, ParquetError>
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.
Sourcepub(crate) fn new_with_num_of_bytes(num_bytes: usize) -> Self
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.
pub(crate) fn new(bitset: &[u8]) -> Self
Sourcepub(crate) fn write<W: Write>(&self, writer: W) -> Result<(), ParquetError>
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.
Sourcefn write_bitset<W: Write>(&self, writer: W) -> Result<(), ParquetError>
fn write_bitset<W: Write>(&self, writer: W) -> Result<(), ParquetError>
Write the bitset in serialized form to the writer.
Sourcefn header(&self) -> BloomFilterHeader
fn header(&self) -> BloomFilterHeader
Create and populate BloomFilterHeader
from this bitset for writing to serialized form
Sourcepub(crate) fn read_from_column_chunk<R: ChunkReader>(
column_metadata: &ColumnChunkMetaData,
reader: Arc<R>,
) -> Result<Option<Self>, ParquetError>
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.
fn hash_to_block_index(&self, hash: u64) -> usize
Sourcepub fn insert<T: AsBytes + ?Sized>(&mut self, value: &T)
pub fn insert<T: AsBytes + ?Sized>(&mut self, value: &T)
Insert an AsBytes value into the filter
Sourcefn insert_hash(&mut self, hash: u64)
fn insert_hash(&mut self, hash: u64)
Insert a hash into the filter
Sourcepub fn check<T: AsBytes>(&self, value: &T) -> bool
pub fn check<T: AsBytes>(&self, value: &T) -> bool
Check if an AsBytes value is probably present or definitely absent in the filter
Sourcefn check_hash(&self, hash: u64) -> bool
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.
Sourcepub(crate) fn estimated_memory_size(&self) -> usize
pub(crate) fn estimated_memory_size(&self) -> usize
Return the total in memory size of this bloom filter in bytes
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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