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

Function finalize_agg_primnode

src/backend/optimizer/plan/subselect.c:3475–3491  ·  view source on GitHub ↗

* finalize_agg_primnode: find all Aggref nodes in the given expression tree, * and add IDs of all PARAM_EXEC params appearing within their aggregated * arguments to the result set. */

Source from the content-addressed store, hash-verified

3473 * arguments to the result set.
3474 */
3475static bool
3476finalize_agg_primnode(Node *node, finalize_primnode_context *context)
3477{
3478 if (node == NULL)
3479 return false;
3480 if (IsA(node, Aggref))
3481 {
3482 Aggref *agg = (Aggref *) node;
3483
3484 /* we should not consider the direct arguments, if any */
3485 finalize_primnode((Node *) agg->args, context);
3486 finalize_primnode((Node *) agg->aggfilter, context);
3487 return false; /* there can't be any Aggrefs below here */
3488 }
3489 return expression_tree_walker(node, finalize_agg_primnode,
3490 (void *) context);
3491}
3492
3493/*
3494 * SS_make_initplan_output_param - make a Param for an initPlan's output

Callers 1

finalize_planFunction · 0.85

Calls 2

finalize_primnodeFunction · 0.85
expression_tree_walkerFunction · 0.85

Tested by

no test coverage detected