[−][src]Struct postgres_parser::nodes::Aggref
Aggref
The aggregate's args list is a targetlist, ie, a list of TargetEntry nodes.
For a normal (nonorderedset) aggregate, the nonresjunk TargetEntries represent the aggregate's regular arguments (if any) and resjunk TLEs can be added at the end to represent ORDER BY expressions that are not also arguments. As in a toplevel Query, the TLEs can be marked with ressortgroupref indexes to let them be referenced by SortGroupClause entries in the aggorder and/or aggdistinct lists. This represents ORDER BY and DISTINCT operations to be applied to the aggregate input rows before they are passed to the transition function. The grammar only allows a simple "DISTINCT" specifier for the arguments, but we use the full querylevel representation to allow more code sharing.
For an orderedset aggregate, the args list represents the WITHIN GROUP (aggregated) arguments, all of which will be listed in the aggorder list. DISTINCT is not supported in this case, so aggdistinct will be NIL. The direct arguments appear in aggdirectargs (as a list of plain expressions, not TargetEntry nodes).
aggtranstype is the data type of the state transition values for this aggregate (resolved to an actual type, if agg's transtype is polymorphic). This is determined during planning and is InvalidOid before that.
aggargtypes is an OID list of the data types of the direct and regular arguments. Normally it's redundant with the aggdirectargs and args lists, but in a combining aggregate, it's not because the args list has been replaced with a single argument representing the partialaggregate transition values.
aggsplit indicates the expected partialaggregation mode for the Aggref's parent plan node. It's always set to AGGSPLIT_SIMPLE in the parser, but the planner might change it to something else. We use this mainly as a crosscheck that the Aggrefs match the plan; but note that when aggsplit indicates a nonfinal mode, aggtype reflects the transition data type not the SQLlevel output type of the aggregate.
Fields
aggfnoid: Oid
aggtype: Oid
aggcollid: Oid
inputcollid: Oid
aggtranstype: Oid
aggargtypes: Option<Vec<Node>>
aggdirectargs: Option<Vec<Node>>
args: Option<Vec<Node>>
aggorder: Option<Vec<Node>>
aggdistinct: Option<Vec<Node>>
aggfilter: Option<Box<Expr>>
aggstar: bool
aggvariadic: bool
aggkind: char
agglevelsup: Index
aggsplit: AggSplit
location: i32
Trait Implementations
impl Debug for Aggref
[src]
impl<'de> Deserialize<'de> for Aggref
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Aggref
[src]
impl PartialEq<Aggref> for Aggref
[src]
impl Serialize for Aggref
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Aggref
[src]
impl StructuralPartialEq for Aggref
[src]
Auto Trait Implementations
impl RefUnwindSafe for Aggref
impl Send for Aggref
impl Sync for Aggref
impl Unpin for Aggref
impl UnwindSafe for Aggref
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,