Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Jan 18, 2022
1 parent 33dea60 commit f860286
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/graph/planner/SequentialPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef GRAPH_PLANNER_PLANNERS_SEQUENTIALPLANNER_H_
#define GRAPH_PLANNER_PLANNERS_SEQUENTIALPLANNER_H_

#include <memory>

#include "graph/context/QueryContext.h"
#include "graph/planner/Planner.h"

Expand Down
13 changes: 11 additions & 2 deletions src/graph/validator/Validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

#include <thrift/lib/cpp/util/EnumUtils.h>

#include <set>

#include "common/function/FunctionManager.h"
#include "graph/planner/plan/PlanNode.h"
#include "graph/planner/plan/Query.h"
#include "graph/util/ExpressionUtils.h"
#include "graph/util/SchemaUtil.h"
Expand Down Expand Up @@ -299,8 +302,14 @@ std::vector<std::string> Validator::getOutColNames() const {
Status Validator::appendPlan(PlanNode* node, PlanNode* appended) {
DCHECK(node != nullptr);
DCHECK(appended != nullptr);
if (!node->isSingleInput()) {
return Status::SemanticError("%s not support to append an input.",

std::set<PlanNode::Kind> skipTypeSet = {PlanNode::Kind::kSwitchSpace};

// Note: there's check which forbids sentence like `[dql(or other) ngql];[cypher]`.
// So there's a kStart planNode in the cypher sentence of end.
// But this check is not needed for `use space` or other sentence.
if (skipTypeSet.find(appended->kind()) != skipTypeSet.end() || !node->isSingleInput()) {
return Status::SemanticError("PlanNode(%s) not support to append an input.",
PlanNode::toString(node->kind()));
}
static_cast<SingleDependencyNode*>(node)->dependsOn(appended);
Expand Down

0 comments on commit f860286

Please sign in to comment.