Struct parquet::file::metadata::LevelHistogram
source · pub struct LevelHistogram { /* private fields */ }
Expand description
Histograms for repetition and definition levels.
Each histogram is a vector of length max_level + 1
. The value at index i
is the number of
values at level i
.
For example, vec[0]
is the number of rows with level 0, vec[1]
is the
number of rows with level 1, and so on.
Implementations§
source§impl LevelHistogram
impl LevelHistogram
sourcepub fn try_new(max_level: i16) -> Option<Self>
pub fn try_new(max_level: i16) -> Option<Self>
Creates a new level histogram data.
Length will be max_level + 1
.
Returns None
when max_level == 0
(because histograms are not necessary in this case)
sourcepub fn into_inner(self) -> Vec<i64>
pub fn into_inner(self) -> Vec<i64>
Return the inner vector, consuming self
sourcepub fn get(&self, index: usize) -> Option<i64>
pub fn get(&self, index: usize) -> Option<i64>
Returns the histogram value at the given index.
The value of i
is the number of values with level i
. For example,
get(1)
returns the number of values with level 1.
Returns None
if the index is out of bounds.
sourcepub fn add(&mut self, other: &Self)
pub fn add(&mut self, other: &Self)
Adds the values from the other histogram to this histogram
§Panics
If the histograms have different lengths
sourcepub fn update_from_levels(&mut self, levels: &[i16])
pub fn update_from_levels(&mut self, levels: &[i16])
Updates histogram values using provided repetition levels
§Panics
if any of the levels is greater than the length of the histogram (
the argument supplied to Self::try_new
)
Trait Implementations§
source§impl Clone for LevelHistogram
impl Clone for LevelHistogram
source§fn clone(&self) -> LevelHistogram
fn clone(&self) -> LevelHistogram
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LevelHistogram
impl Debug for LevelHistogram
source§impl Default for LevelHistogram
impl Default for LevelHistogram
source§fn default() -> LevelHistogram
fn default() -> LevelHistogram
source§impl From<LevelHistogram> for Vec<i64>
impl From<LevelHistogram> for Vec<i64>
source§fn from(value: LevelHistogram) -> Self
fn from(value: LevelHistogram) -> Self
source§impl Hash for LevelHistogram
impl Hash for LevelHistogram
source§impl PartialEq for LevelHistogram
impl PartialEq for LevelHistogram
impl Eq for LevelHistogram
impl StructuralPartialEq for LevelHistogram
Auto Trait Implementations§
impl Freeze for LevelHistogram
impl RefUnwindSafe for LevelHistogram
impl Send for LevelHistogram
impl Sync for LevelHistogram
impl Unpin for LevelHistogram
impl UnwindSafe for LevelHistogram
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)