pub struct PercentileDiscAccumulator { /* private fields */ }Expand description
Accumulator for the ordered-set aggregate PERCENTILE_DISC (issue #148).
Buffers (sort_keys, value) pairs, sorts them at finalize, and returns the
first value whose cumulative distribution reaches the fraction:
index = max(ceil(fraction * n) - 1, 0) — PostgreSQL 16 semantics (D5).
NULL sort values are excluded; an empty group yields NULL. Partial state is
rejected: ordered-set aggregation always runs in Single mode (D11).
Implementations§
Trait Implementations§
Source§impl Accumulator for PercentileDiscAccumulator
impl Accumulator for PercentileDiscAccumulator
Source§fn update(&mut self, value: Option<SqlValue>) -> Result<()>
fn update(&mut self, value: Option<SqlValue>) -> Result<()>
Update the accumulator with a new value (None for COUNT(*) rows).
Source§fn update_ordered(
&mut self,
value: Option<SqlValue>,
sort_keys: &[SqlValue],
) -> Result<()>
fn update_ordered( &mut self, value: Option<SqlValue>, sort_keys: &[SqlValue], ) -> Result<()>
Update with the row’s aggregate-local sort key values (issue #148). Read more
Source§fn finalize(&self) -> Result<SqlValue>
fn finalize(&self) -> Result<SqlValue>
Finalize the accumulator and return the resulting SqlValue.
Source§fn merge(&mut self, _state: &[SqlValue]) -> Result<()>
fn merge(&mut self, _state: &[SqlValue]) -> Result<()>
Merge a partial state produced by an accumulator of the same function.
Source§fn clone_box(&self) -> Box<dyn Accumulator>
fn clone_box(&self) -> Box<dyn Accumulator>
Clone the accumulator as a trait object.
Source§fn retained_bytes(&self) -> u64
fn retained_bytes(&self) -> u64
Estimated bytes retained by dynamically allocated accumulator state. Read more
Source§impl Clone for PercentileDiscAccumulator
impl Clone for PercentileDiscAccumulator
Source§fn clone(&self) -> PercentileDiscAccumulator
fn clone(&self) -> PercentileDiscAccumulator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PercentileDiscAccumulator
impl RefUnwindSafe for PercentileDiscAccumulator
impl Send for PercentileDiscAccumulator
impl Sync for PercentileDiscAccumulator
impl Unpin for PercentileDiscAccumulator
impl UnsafeUnpin for PercentileDiscAccumulator
impl UnwindSafe for PercentileDiscAccumulator
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
Mutably borrows from an owned value. Read more