MCPcopy Create free account
hub / github.com/ByConity/ByConity / explainStep

Function explainStep

src/QueryPlan/QueryPlan.cpp:368–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366
367
368static void explainStep(const IQueryPlanStep & step, JSONBuilder::JSONMap & map, const QueryPlan::ExplainPlanOptions & options)
369{
370 map.add("Node Type", step.getName());
371
372 if (options.description)
373 {
374 const auto & description = step.getStepDescription();
375 if (!description.empty())
376 map.add("Description", description);
377 }
378
379 if (options.header && step.hasOutputStream())
380 {
381 auto header_array = std::make_unique<JSONBuilder::JSONArray>();
382
383 for (const auto & output_column : step.getOutputStream().header)
384 {
385 auto column_map = std::make_unique<JSONBuilder::JSONMap>();
386 column_map->add("Name", output_column.name);
387 if (output_column.type)
388 column_map->add("Type", output_column.type->getName());
389
390 header_array->add(std::move(column_map));
391 }
392
393 map.add("Header", std::move(header_array));
394 }
395
396 if (options.actions)
397 step.describeActions(map);
398
399 if (options.indexes)
400 step.describeIndexes(map);
401}
402
403JSONBuilder::ItemPtr QueryPlan::explainPlan(const ExplainPlanOptions & options)
404{

Callers 2

explainPlanMethod · 0.85
debugExplainStepFunction · 0.85

Calls 9

hasOutputStreamMethod · 0.80
dumpNameAndTypeMethod · 0.80
addMethod · 0.45
getNameMethod · 0.45
emptyMethod · 0.45
getOutputStreamMethod · 0.45
describeActionsMethod · 0.45
describeIndexesMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected