Struct parquet::file::statistics::ValueStatistics
source · pub struct ValueStatistics<T> { /* private fields */ }
Expand description
Typed statistics for one column chunk
See Statistics
for more details
Implementations§
source§impl<T: ParquetValueType> ValueStatistics<T>
impl<T: ParquetValueType> ValueStatistics<T>
sourcepub fn new(
min: Option<T>,
max: Option<T>,
distinct_count: Option<u64>,
null_count: Option<u64>,
is_min_max_deprecated: bool,
) -> Self
pub fn new( min: Option<T>, max: Option<T>, distinct_count: Option<u64>, null_count: Option<u64>, is_min_max_deprecated: bool, ) -> Self
Creates new typed statistics.
sourcepub fn with_min_is_exact(self, is_min_value_exact: bool) -> Self
pub fn with_min_is_exact(self, is_min_value_exact: bool) -> Self
Set whether the stored min
field represents the exact
minimum, or just a bound on the minimum value.
sourcepub fn with_max_is_exact(self, is_max_value_exact: bool) -> Self
pub fn with_max_is_exact(self, is_max_value_exact: bool) -> Self
Set whether the stored max
field represents the exact
maximum, or just a bound on the maximum value.
sourcepub fn with_backwards_compatible_min_max(
self,
backwards_compatible: bool,
) -> Self
pub fn with_backwards_compatible_min_max( self, backwards_compatible: bool, ) -> Self
Set whether to write the deprecated min
and max
fields
for compatibility with older parquet writers
This should only be enabled if the field is signed,
see Self::is_min_max_backwards_compatible
sourcepub fn min(&self) -> &T
👎Deprecated since 53.0.0: Use min_opt
instead
pub fn min(&self) -> &T
min_opt
insteadReturns min value of the statistics.
Panics if min value is not set, e.g. all values are null
.
Use has_min_max_set
method to check that.
sourcepub fn max(&self) -> &T
👎Deprecated since 53.0.0: Use max_opt
instead
pub fn max(&self) -> &T
max_opt
insteadReturns max value of the statistics.
Panics if max value is not set, e.g. all values are null
.
Use has_min_max_set
method to check that.
sourcepub fn min_bytes_opt(&self) -> Option<&[u8]>
pub fn min_bytes_opt(&self) -> Option<&[u8]>
Returns min value as bytes of the statistics, if min value is known.
sourcepub fn min_bytes(&self) -> &[u8] ⓘ
👎Deprecated since 53.0.0: Use min_bytes_opt
instead
pub fn min_bytes(&self) -> &[u8] ⓘ
min_bytes_opt
insteadReturns min value as bytes of the statistics.
Panics if min value is not set, use has_min_max_set
method to check
if values are set.
sourcepub fn max_bytes_opt(&self) -> Option<&[u8]>
pub fn max_bytes_opt(&self) -> Option<&[u8]>
Returns max value as bytes of the statistics, if max value is known.
sourcepub fn max_bytes(&self) -> &[u8] ⓘ
👎Deprecated since 53.0.0: Use max_bytes_opt
instead
pub fn max_bytes(&self) -> &[u8] ⓘ
max_bytes_opt
insteadReturns max value as bytes of the statistics.
Panics if max value is not set, use has_min_max_set
method to check
if values are set.
sourcepub fn has_min_max_set(&self) -> bool
👎Deprecated since 53.0.0: Use min_opt
and max_opt
methods instead
pub fn has_min_max_set(&self) -> bool
min_opt
and max_opt
methods insteadWhether or not min and max values are set.
Normally both min/max values will be set to Some(value)
or None
.
sourcepub fn max_is_exact(&self) -> bool
pub fn max_is_exact(&self) -> bool
Whether or not max value is set, and is an exact value.
sourcepub fn min_is_exact(&self) -> bool
pub fn min_is_exact(&self) -> bool
Whether or not min value is set, and is an exact value.
sourcepub fn distinct_count(&self) -> Option<u64>
pub fn distinct_count(&self) -> Option<u64>
Returns optional value of number of distinct values occurring.
sourcepub fn null_count(&self) -> u64
👎Deprecated since 53.0.0: Use null_count_opt
method instead
pub fn null_count(&self) -> u64
null_count_opt
method insteadReturns number of null values for the column. Note that this includes all nulls when column is part of the complex type.
sourcepub fn null_count_opt(&self) -> Option<u64>
pub fn null_count_opt(&self) -> Option<u64>
Returns null count.
sourcepub fn is_min_max_backwards_compatible(&self) -> bool
pub fn is_min_max_backwards_compatible(&self) -> bool
Old versions of parquet stored statistics in min
and max
fields, ordered
using signed comparison. This resulted in an undefined ordering for unsigned
quantities, such as booleans and unsigned integers.
These fields were therefore deprecated in favour of min_value
and max_value
,
which have a type-defined sort order.
However, not all readers have been updated. For backwards compatibility, this method
returns true
if the statistics within this have a signed sort order, that is
compatible with being stored in the deprecated min
and max
fields
Trait Implementations§
source§impl<T: Clone> Clone for ValueStatistics<T>
impl<T: Clone> Clone for ValueStatistics<T>
source§fn clone(&self) -> ValueStatistics<T>
fn clone(&self) -> ValueStatistics<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: ParquetValueType> Debug for ValueStatistics<T>
impl<T: ParquetValueType> Debug for ValueStatistics<T>
source§impl<T: ParquetValueType> Display for ValueStatistics<T>
impl<T: ParquetValueType> Display for ValueStatistics<T>
source§impl<T: ParquetValueType> From<ValueStatistics<T>> for Statistics
impl<T: ParquetValueType> From<ValueStatistics<T>> for Statistics
source§fn from(t: ValueStatistics<T>) -> Self
fn from(t: ValueStatistics<T>) -> Self
source§impl<T: PartialEq> PartialEq for ValueStatistics<T>
impl<T: PartialEq> PartialEq for ValueStatistics<T>
impl<T: Eq> Eq for ValueStatistics<T>
impl<T> StructuralPartialEq for ValueStatistics<T>
Auto Trait Implementations§
impl<T> Freeze for ValueStatistics<T>where
T: Freeze,
impl<T> RefUnwindSafe for ValueStatistics<T>where
T: RefUnwindSafe,
impl<T> Send for ValueStatistics<T>where
T: Send,
impl<T> Sync for ValueStatistics<T>where
T: Sync,
impl<T> Unpin for ValueStatistics<T>where
T: Unpin,
impl<T> UnwindSafe for ValueStatistics<T>where
T: UnwindSafe,
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
)