[][src]Struct postgres_parser::sys::GroupingFunc

#[repr(C)]pub struct GroupingFunc {
    pub xpr: Expr,
    pub args: *mut List,
    pub refs: *mut List,
    pub cols: *mut List,
    pub agglevelsup: Index,
    pub location: c_int,
}

GroupingFunc

A GroupingFunc is a GROUPING(...) expression, which behaves in many ways like an aggregate function (e.g. it "belongs" to a specific query level, which might not be the one immediately containing it), but also differs in an important respect: it never evaluates its arguments, they merely designate expressions from the GROUP BY clause of the query level to which it belongs.

The spec defines the evaluation of GROUPING() purely by syntactic replacement, but we make it a real expression for optimization purposes so that one Agg node can handle multiple grouping sets at once. Evaluating the result only needs the column positions to check against the grouping set being projected. However, for EXPLAIN to produce meaningful output, we have to keep the original expressions around, since expression deparse does not give us any feasible way to get at the GROUP BY clause.

Also, we treat two GroupingFunc nodes as equal if they have equal arguments lists and agglevelsup, without comparing the refs and cols annotations.

In raw parse output we have only the args list; parse analysis fills in the refs list, and the planner fills in the cols list.

Fields

xpr: Exprargs: *mut Listrefs: *mut List

arguments, not evaluated but kept for benefit of EXPLAIN etc.

cols: *mut List

ressortgrouprefs of arguments

agglevelsup: Index

actual column positions set by planner

location: c_int

same as Aggref.agglevelsup

Trait Implementations

impl Debug for GroupingFunc[src]

impl Default for GroupingFunc[src]

impl Eq for GroupingFunc[src]

impl Hash for GroupingFunc[src]

impl PartialEq<GroupingFunc> for GroupingFunc[src]

impl StructuralEq for GroupingFunc[src]

impl StructuralPartialEq for GroupingFunc[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.