Skip to main content

AggregateFunc

Enum AggregateFunc 

Source
pub enum AggregateFunc {
Show 19 variants Count, Sum, Total, Avg, Min, Max, GroupConcat, JsonGroupArray, JsonbGroupArray, JsonGroupObject, JsonbGroupObject, Median, GeopolyGroupBbox, VectorSum, VectorAvg, Percentile, PercentileCont, PercentileDisc, External,
}
Expand description

An aggregate built-in.

Variants§

§

Count

count(x) and count(*)

§

Sum

sum(x)

§

Total

total(x)

§

Avg

avg(x)

§

Min

min(x)

§

Max

max(x)

§

GroupConcat

group_concat(x[, sep]) and string_agg(x, sep)

§

JsonGroupArray

json_group_array(x)

§

JsonbGroupArray

jsonb_group_array(x)

§

JsonGroupObject

json_group_object(label, x)

§

JsonbGroupObject

jsonb_group_object(label, x)

§

Median

median(x), which is percentile_cont(x, 0.5) under a shorter name.

§

GeopolyGroupBbox

geopoly_group_bbox(P), the box that holds every polygon in the group.

§

VectorSum

sum(v) and total(v) over a vector column, component by component.

Not a name a caller writes: the binder picks it when sum’s argument reads a vector, because that is where the argument’s type is known.

§

VectorAvg

avg(v) over a vector column, component by component.

§

Percentile

percentile(x, p), where p runs 0 to 100.

§

PercentileCont

percentile_cont(x, f), where f runs 0 to 1 and the answer is interpolated between the two rows it falls between.

§

PercentileDisc

percentile_disc(x, f), which answers one of the rows rather than a value between two of them.

§

External

An aggregate an application registered, named beside the call.

The name is not in here because this enum is Copy and travels through the program’s operands; it rides in AggregateCall instead.

Trait Implementations§

Source§

impl Clone for AggregateFunc

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AggregateFunc

Source§

impl Debug for AggregateFunc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AggregateFunc

Source§

impl PartialEq for AggregateFunc

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AggregateFunc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.