| 366 | |
| 367 | |
| 368 | static 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 | |
| 403 | JSONBuilder::ItemPtr QueryPlan::explainPlan(const ExplainPlanOptions & options) |
| 404 | { |
no test coverage detected