MCPcopy Create free account
hub / github.com/apache/cloudberry / build_aggregate_combinefn_expr

Function build_aggregate_combinefn_expr

src/backend/parser/parse_agg.c:2111–2134  ·  view source on GitHub ↗

* Like build_aggregate_transfn_expr, but creates an expression tree for the * combine function of an aggregate, rather than the transition function. */

Source from the content-addressed store, hash-verified

2109 * combine function of an aggregate, rather than the transition function.
2110 */
2111void
2112build_aggregate_combinefn_expr(Oid agg_state_type,
2113 Oid agg_input_collation,
2114 Oid combinefn_oid,
2115 Expr **combinefnexpr)
2116{
2117 Node *argp;
2118 List *args;
2119 FuncExpr *fexpr;
2120
2121 /* combinefn takes two arguments of the aggregate state type */
2122 argp = make_agg_arg(agg_state_type, agg_input_collation);
2123
2124 args = list_make2(argp, argp);
2125
2126 fexpr = makeFuncExpr(combinefn_oid,
2127 agg_state_type,
2128 args,
2129 InvalidOid,
2130 agg_input_collation,
2131 COERCE_EXPLICIT_CALL);
2132 /* combinefn is currently never treated as variadic */
2133 *combinefnexpr = (Expr *) fexpr;
2134}
2135
2136/*
2137 * Like build_aggregate_transfn_expr, but creates an expression tree for the

Callers 1

Calls 2

make_agg_argFunction · 0.85
makeFuncExprFunction · 0.85

Tested by

no test coverage detected