1
0
Fork 0

Add K_SHORTEST_PATHS handling to optimizer and executor (#8895)

There were a few places where K_SHORTEST_PATHS was not handled. This
commit adds them.
This commit is contained in:
Markus Pfeiffer 2019-05-07 11:54:35 +00:00 committed by Michael Hackstein
parent 257f036478
commit d586ff8e95
5 changed files with 9 additions and 4 deletions

View File

@ -450,6 +450,7 @@ struct UserVarFinder final : public WalkerWorker<ExecutionNode> {
en->getType() == ExecutionNode::ENUMERATE_LIST ||
en->getType() == ExecutionNode::TRAVERSAL ||
en->getType() == ExecutionNode::SHORTEST_PATH ||
en->getType() == ExecutionNode::K_SHORTEST_PATHS ||
en->getType() == ExecutionNode::ENUMERATE_IRESEARCH_VIEW ||
en->getType() == ExecutionNode::COLLECT) {
depth += 1;

View File

@ -218,7 +218,8 @@ struct Instanciator final : public WalkerWorker<ExecutionNode> {
ExecutionBlock* block = nullptr;
{
if (en->getType() == ExecutionNode::TRAVERSAL ||
en->getType() == ExecutionNode::SHORTEST_PATH) {
en->getType() == ExecutionNode::SHORTEST_PATH ||
en->getType() == ExecutionNode::K_SHORTEST_PATHS) {
// We have to prepare the options before we build the block
ExecutionNode::castTo<GraphNode*>(en)->prepareOptions();
}

View File

@ -617,7 +617,8 @@ ExecutionNode const* ExecutionNode::getLoop() const {
auto type = node->getType();
if (type == ENUMERATE_COLLECTION || type == INDEX || type == TRAVERSAL ||
type == ENUMERATE_LIST || type == SHORTEST_PATH || type == ENUMERATE_IRESEARCH_VIEW) {
type == ENUMERATE_LIST || type == SHORTEST_PATH ||
type == K_SHORTEST_PATHS || type == ENUMERATE_IRESEARCH_VIEW) {
return node;
}
}
@ -1769,7 +1770,8 @@ bool SubqueryNode::mayAccessCollections() {
ExecutionNode::REMOVE,
ExecutionNode::UPSERT,
ExecutionNode::TRAVERSAL,
ExecutionNode::SHORTEST_PATH};
ExecutionNode::SHORTEST_PATH,
ExecutionNode::K_SHORTEST_PATHS};
SmallVector<ExecutionNode*>::allocator_type::arena_type a;
SmallVector<ExecutionNode*> nodes{a};

View File

@ -2094,7 +2094,7 @@ class arangodb::aql::RedundantCalculationsReplacer final
}
case EN::K_SHORTEST_PATHS: {
replaceStartTargetVariables<ShortestPathNode>(en);
replaceStartTargetVariables<KShortestPathsNode>(en);
break;
}

View File

@ -513,6 +513,7 @@ bool TraversalConditionFinder::before(ExecutionNode* en) {
case EN::ENUMERATE_COLLECTION:
case EN::LIMIT:
case EN::SHORTEST_PATH:
case EN::K_SHORTEST_PATHS:
case EN::ENUMERATE_IRESEARCH_VIEW:
{
// in these cases we simply ignore the intermediate nodes, note