From c11d391e622cab7c4c19165a8c68eb79252f0c40 Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Wed, 22 Jan 2020 13:30:11 +0100 Subject: [PATCH] Print the type of ExpandVariable in EXPLAIN Reviewers: mferencevic, ipaljak Reviewed By: mferencevic, ipaljak Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2631 --- src/query/plan/pretty_print.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/query/plan/pretty_print.cpp b/src/query/plan/pretty_print.cpp index 4577be61d..49ee80de6 100644 --- a/src/query/plan/pretty_print.cpp +++ b/src/query/plan/pretty_print.cpp @@ -97,8 +97,23 @@ bool PlanPrinter::PreVisit(query::plan::Expand &op) { } bool PlanPrinter::PreVisit(query::plan::ExpandVariable &op) { + using Type = query::EdgeAtom::Type; WithPrintLn([&](auto &out) { - *out_ << "* ExpandVariable (" << op.input_symbol_.name() << ")" + *out_ << "* "; + switch (op.type_) { + case Type::DEPTH_FIRST: + *out_ << "ExpandVariable"; + break; + case Type::BREADTH_FIRST: + *out_ << (op.common_.existing_node ? "STShortestPath" : "BFSExpand"); + break; + case Type::WEIGHTED_SHORTEST_PATH: + *out_ << "WeightedShortestPath"; + break; + case Type::SINGLE: + LOG(FATAL) << "Unexpected ExpandVariable::type_"; + } + *out_ << " (" << op.input_symbol_.name() << ")" << (op.common_.direction == query::EdgeAtom::Direction::IN ? "<-" : "-") << "[" << op.common_.edge_symbol.name();