pub struct DecimalColumn { /* private fields */ }Expand description
A column of exact decimals: Arrow Decimal128(precision, scale). Each
value is a whole number (i128) and the column has one scale, so 1.25
at scale 2 is stored as 125. A gap is an Arrow null.
pond-ts has no decimal kind. pond-rs keeps decimals exact through
count, first, last, min, max, keep, sum and difference;
every other reducer works on the nearest f64 and gives a number
column (or, for unique, top<N> and samples, a list of numbers).
Implementations§
Source§impl DecimalColumn
impl DecimalColumn
Sourcepub fn from_options(
values: impl IntoIterator<Item = Option<i128>>,
scale: i8,
) -> Result<Self>
pub fn from_options( values: impl IntoIterator<Item = Option<i128>>, scale: i8, ) -> Result<Self>
Build from raw whole numbers at scale (None is a gap), with the
widest precision, 38 digits. An error if a value has more than 38
digits or scale is outside -38..=38.
Sourcepub fn from_values(values: Vec<i128>, scale: i8) -> Result<Self>
pub fn from_values(values: Vec<i128>, scale: i8) -> Result<Self>
DecimalColumn::from_options with no gaps.
Sourcepub fn precision(&self) -> u8
pub fn precision(&self) -> u8
The most digits a value may have (Arrow’s precision, at most 38).
Sourcepub fn get(&self, i: usize) -> Option<Decimal>
pub fn get(&self, i: usize) -> Option<Decimal>
The value at i, or None for a gap. Panics if i is out of range.
Sourcepub fn missing_count(&self) -> usize
pub fn missing_count(&self) -> usize
Number of gaps.
Trait Implementations§
Source§impl Clone for DecimalColumn
impl Clone for DecimalColumn
Source§impl Debug for DecimalColumn
impl Debug for DecimalColumn
Source§impl From<DecimalColumn> for ColumnData
impl From<DecimalColumn> for ColumnData
Source§fn from(c: DecimalColumn) -> Self
fn from(c: DecimalColumn) -> Self
Source§impl PartialEq for DecimalColumn
impl PartialEq for DecimalColumn
impl StructuralPartialEq for DecimalColumn
Auto Trait Implementations§
impl Freeze for DecimalColumn
impl RefUnwindSafe for DecimalColumn
impl Send for DecimalColumn
impl Sync for DecimalColumn
impl Unpin for DecimalColumn
impl UnsafeUnpin for DecimalColumn
impl UnwindSafe for DecimalColumn
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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