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

Function finalize_grouping_exprs

src/backend/parser/parse_agg.c:1546–1563  ·  view source on GitHub ↗

* finalize_grouping_exprs - * Scan the given expression tree for GROUPING() and related calls, * and validate and process their arguments. * * This is split out from check_ungrouped_columns above because it needs * to modify the nodes (which it does in-place, not via a mutator) while * check_ungrouped_columns may see only a copy of the original thanks to * flattening of join alias vars.

Source from the content-addressed store, hash-verified

1544 * GROUPING argument as we see it before comparing it.
1545 */
1546static void
1547finalize_grouping_exprs(Node *node, ParseState *pstate, Query *qry,
1548 List *groupClauses, bool hasJoinRTEs,
1549 bool have_non_var_grouping)
1550{
1551 check_ungrouped_columns_context context;
1552
1553 context.pstate = pstate;
1554 context.qry = qry;
1555 context.hasJoinRTEs = hasJoinRTEs;
1556 context.groupClauses = groupClauses;
1557 context.groupClauseCommonVars = NIL;
1558 context.have_non_var_grouping = have_non_var_grouping;
1559 context.func_grouped_rels = NULL;
1560 context.sublevels_up = 0;
1561 context.in_agg_direct_args = false;
1562 finalize_grouping_exprs_walker(node, &context);
1563}
1564
1565static bool
1566finalize_grouping_exprs_walker(Node *node,

Callers 1

parseCheckAggregatesFunction · 0.85

Calls 1

Tested by

no test coverage detected