pub struct Aggref {
pub oid: u32,
pub kind: u8,
pub direct: Vec<Expr>,
pub args: Vec<Expr>,
pub nargs: usize,
pub order: Vec<SortGroup>,
pub distinct: Vec<SortGroup>,
pub star: bool,
pub variadic: bool,
pub filter: Option<Box<Expr>>,
pub levels_up: usize,
}Expand description
A call of an aggregate function, as Aggref.
Fields§
§oid: u32aggfnoid: the OID of the aggregate function in pg_proc.
kind: u8aggkind: n for a normal aggregate, o for an ordered-set aggregate or h for a hypothetical-set aggregate.
direct: Vec<Expr>aggdirectargs: the direct arguments of an ordered-set aggregate, which the aggregate reads once for each group.
args: Vec<Expr>The arguments, then the expressions that only the ORDER BY of the call reads.
nargs: usizeThe number of arguments at the start of args.
order: Vec<SortGroup>aggorder: the items of the ORDER BY of the call. Each item names an expression of args.
distinct: Vec<SortGroup>aggdistinct: the items of DISTINCT, which are all the arguments. The items of ORDER BY come first.
star: boolaggstar: true for count(*).
variadic: boolaggvariadic: true when the last argument is the array of a variadic aggregate.
filter: Option<Box<Expr>>aggfilter: the condition of FILTER (WHERE ...).
levels_up: usizeagglevelsup: 0 for an aggregate of the query that has the call, 1 for an aggregate of the query outside it, and so on. The arguments of an aggregate of an outer query read only the columns of that query and of the queries outside it.