[][src]Struct postgres_parser::nodes::GroupingFunc

pub struct GroupingFunc {
    pub args: Option<Vec<Node>>,
    pub refs: Option<Vec<Node>>,
    pub cols: Option<Vec<Node>>,
    pub agglevelsup: Index,
    pub location: i32,
}

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

args: Option<Vec<Node>>refs: Option<Vec<Node>>cols: Option<Vec<Node>>agglevelsup: Indexlocation: i32

Trait Implementations

impl Debug for GroupingFunc[src]

impl<'de> Deserialize<'de> for GroupingFunc[src]

impl Eq for GroupingFunc[src]

impl PartialEq<GroupingFunc> for GroupingFunc[src]

impl Serialize 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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.