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

Function project_aggregates

src/backend/executor/nodeAgg.c:1422–1442  ·  view source on GitHub ↗

* Project the result of a group (whose aggs have already been calculated by * finalize_aggregates). Returns the result slot, or NULL if no row is * projected (suppressed by qual). */

Source from the content-addressed store, hash-verified

1420 * projected (suppressed by qual).
1421 */
1422static TupleTableSlot *
1423project_aggregates(AggState *aggstate)
1424{
1425 ExprContext *econtext = aggstate->ss.ps.ps_ExprContext;
1426
1427 /*
1428 * Check the qual (HAVING clause); if the group does not match, ignore it.
1429 */
1430 if (ExecQual(aggstate->ss.ps.qual, econtext))
1431 {
1432 /*
1433 * Form and return projection tuple using the aggregate results and
1434 * the representative input tuple.
1435 */
1436 return ExecProject(aggstate->ss.ps.ps_ProjInfo);
1437 }
1438 else
1439 InstrCountFiltered1(aggstate, 1);
1440
1441 return NULL;
1442}
1443
1444/*
1445 * Find input-tuple columns that are needed, dividing them into

Callers 2

agg_retrieve_directFunction · 0.85

Calls 2

ExecQualFunction · 0.85
ExecProjectFunction · 0.85

Tested by

no test coverage detected