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

Function ExplainOpenSetAsideGroup

src/backend/commands/explain.c:5746–5773  ·  view source on GitHub ↗

* Open a group of related objects, without emitting actual data. * * Prepare the formatting state as though we were beginning a group with * the identified properties, but don't actually emit anything. Output * subsequent to this call can be redirected into a separate output buffer, * and then eventually appended to the main output buffer after doing a * regular ExplainOpenGroup call (with

Source from the content-addressed store, hash-verified

5744 * pop this state with ExplainSaveGroup.
5745 */
5746static void
5747ExplainOpenSetAsideGroup(const char *objtype, const char *labelname,
5748 bool labeled, int depth, ExplainState *es)
5749{
5750 switch (es->format)
5751 {
5752 case EXPLAIN_FORMAT_TEXT:
5753 /* nothing to do */
5754 break;
5755
5756 case EXPLAIN_FORMAT_XML:
5757 es->indent += depth;
5758 break;
5759
5760 case EXPLAIN_FORMAT_JSON:
5761 es->grouping_stack = lcons_int(0, es->grouping_stack);
5762 es->indent += depth;
5763 break;
5764
5765 case EXPLAIN_FORMAT_YAML:
5766 if (labelname)
5767 es->grouping_stack = lcons_int(1, es->grouping_stack);
5768 else
5769 es->grouping_stack = lcons_int(0, es->grouping_stack);
5770 es->indent += depth;
5771 break;
5772 }
5773}
5774
5775/*
5776 * Pop one level of grouping state, allowing for a re-push later.

Callers 1

ExplainOpenWorkerFunction · 0.85

Calls 1

lcons_intFunction · 0.85

Tested by

no test coverage detected