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

Function show_tuple_split_keys

src/backend/commands/explain.c:3274–3311  ·  view source on GitHub ↗

* Show the Split key for an SplitTuple */

Source from the content-addressed store, hash-verified

3272 * Show the Split key for an SplitTuple
3273 */
3274static void
3275show_tuple_split_keys(TupleSplitState *tstate, List *ancestors,
3276 ExplainState *es)
3277{
3278 TupleSplit *plan = (TupleSplit *)tstate->ss.ps.plan;
3279
3280 ancestors = lcons(tstate, ancestors);
3281
3282 List *context;
3283 bool useprefix;
3284 List *result = NIL;
3285 /* Set up deparsing context */
3286 context = set_deparse_context_plan(es->deparse_cxt,
3287 (Plan *) plan,
3288 ancestors);
3289 useprefix = (list_length(es->rtable) > 1 || es->verbose);
3290
3291 StringInfoData buf;
3292 initStringInfo(&buf);
3293
3294 ListCell *lc;
3295 foreach(lc, plan->dqa_expr_lst)
3296 {
3297 DQAExpr *dqa_expr = (DQAExpr *)lfirst(lc);
3298 result = lappend(result,
3299 deparse_expression((Node *) dqa_expr, context,
3300 useprefix, true));
3301 }
3302 ExplainPropertyList("Split by Col", result, es);
3303
3304 if (plan->numCols > 0)
3305 show_sort_group_keys(outerPlanState(tstate), "Group Key",
3306 plan->numCols, 0, plan->grpColIdx,
3307 NULL, NULL, NULL,
3308 ancestors, es);
3309
3310 ancestors = list_delete_first(ancestors);
3311}
3312
3313/*
3314 * Show the grouping keys for an Agg node.

Callers 1

ExplainNodeFunction · 0.85

Calls 10

lconsFunction · 0.85
set_deparse_context_planFunction · 0.85
list_lengthFunction · 0.85
initStringInfoFunction · 0.85
lappendFunction · 0.85
deparse_expressionFunction · 0.85
ExplainPropertyListFunction · 0.85
show_sort_group_keysFunction · 0.85
list_delete_firstFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected