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

Function ExplainPropertyListNested

src/backend/commands/explain.c:5437–5477  ·  view source on GitHub ↗

* Explain a property that takes the form of a list of unlabeled items within * another list. "data" is a list of C strings. */

Source from the content-addressed store, hash-verified

5435 * another list. "data" is a list of C strings.
5436 */
5437void
5438ExplainPropertyListNested(const char *qlabel, List *data, ExplainState *es)
5439{
5440 ListCell *lc;
5441 bool first = true;
5442
5443 switch (es->format)
5444 {
5445 case EXPLAIN_FORMAT_TEXT:
5446 case EXPLAIN_FORMAT_XML:
5447 ExplainPropertyList(qlabel, data, es);
5448 return;
5449
5450 case EXPLAIN_FORMAT_JSON:
5451 ExplainJSONLineEnding(es);
5452 appendStringInfoSpaces(es->str, es->indent * 2);
5453 appendStringInfoChar(es->str, '[');
5454 foreach(lc, data)
5455 {
5456 if (!first)
5457 appendStringInfoString(es->str, ", ");
5458 escape_json(es->str, (const char *) lfirst(lc));
5459 first = false;
5460 }
5461 appendStringInfoChar(es->str, ']');
5462 break;
5463
5464 case EXPLAIN_FORMAT_YAML:
5465 ExplainYAMLLineStarting(es);
5466 appendStringInfoString(es->str, "- [");
5467 foreach(lc, data)
5468 {
5469 if (!first)
5470 appendStringInfoString(es->str, ", ");
5471 escape_yaml(es->str, (const char *) lfirst(lc));
5472 first = false;
5473 }
5474 appendStringInfoChar(es->str, ']');
5475 break;
5476 }
5477}
5478
5479/*
5480 * Explain a simple property.

Callers 1

show_grouping_set_keysFunction · 0.85

Calls 9

ExplainPropertyListFunction · 0.85
ExplainJSONLineEndingFunction · 0.85
appendStringInfoSpacesFunction · 0.85
appendStringInfoCharFunction · 0.85
appendStringInfoStringFunction · 0.85
escape_jsonFunction · 0.85
ExplainYAMLLineStartingFunction · 0.85
escape_yamlFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected