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

Function find_cols

src/backend/executor/nodeAgg.c:1448–1469  ·  view source on GitHub ↗

* Find input-tuple columns that are needed, dividing them into * aggregated and unaggregated sets. */

Source from the content-addressed store, hash-verified

1446 * aggregated and unaggregated sets.
1447 */
1448static void
1449find_cols(AggState *aggstate, Bitmapset **aggregated, Bitmapset **unaggregated)
1450{
1451 Agg *agg = (Agg *) aggstate->ss.ps.plan;
1452 FindColsContext context;
1453
1454 context.is_aggref = false;
1455 context.aggregated = NULL;
1456 context.unaggregated = NULL;
1457
1458 /* Examine tlist and quals */
1459 (void) find_cols_walker((Node *) agg->plan.targetlist, &context);
1460 (void) find_cols_walker((Node *) agg->plan.qual, &context);
1461
1462 /* In some cases, grouping columns will not appear in the tlist */
1463 for (int i = 0; i < agg->numCols; i++)
1464 context.unaggregated = bms_add_member(context.unaggregated,
1465 agg->grpColIdx[i]);
1466
1467 *aggregated = context.aggregated;
1468 *unaggregated = context.unaggregated;
1469}
1470
1471static bool
1472find_cols_walker(Node *node, FindColsContext *context)

Callers 1

find_hash_columnsFunction · 0.85

Calls 2

find_cols_walkerFunction · 0.85
bms_add_memberFunction · 0.85

Tested by

no test coverage detected