#[non_exhaustive]pub enum DistinctHandling {
Insensitive,
Sensitive,
Unsupported,
}Expand description
How an aggregate function treats the DISTINCT modifier.
Mathematically, Insensitive means the function’s merge operation is
idempotent (its state forms a semilattice): f(S ⊎ S) = f(S), so
removing duplicates from the input cannot change the result.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Insensitive
The result is the same with or without DISTINCT, so the planner
is free to drop it. min, max, bool_and, bit_or, …
Sensitive
The accumulator reads AccumulatorArgs::is_distinct and deduplicates
its input, so the planner must leave the flag alone. count, sum,
avg, var_samp, array_agg, … This is the default.
Unsupported
The accumulator does not implement DISTINCT: it does not read
is_distinct, or it rejects DISTINCT with an error. The planner has
to deduplicate the input first (today SingleDistinctToGroupBy does
that for single-argument functions) or reject the query. stddev,
approx_median, corr, regr_*, nth_value, …
Trait Implementations§
Source§impl Clone for DistinctHandling
impl Clone for DistinctHandling
impl Copy for DistinctHandling
Source§impl Debug for DistinctHandling
impl Debug for DistinctHandling
impl Eq for DistinctHandling
Source§impl PartialEq for DistinctHandling
impl PartialEq for DistinctHandling
impl StructuralPartialEq for DistinctHandling
Auto Trait Implementations§
impl Forget for DistinctHandling
impl Freeze for DistinctHandling
impl Move for DistinctHandling
impl RefUnwindSafe for DistinctHandling
impl Send for DistinctHandling
impl Sync for DistinctHandling
impl Unpin for DistinctHandling
impl UnsafeUnpin for DistinctHandling
impl UnwindSafe for DistinctHandling
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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