diff --git a/src/graph/planner/match/MatchClausePlanner.cpp b/src/graph/planner/match/MatchClausePlanner.cpp index 962cd3dfcb6..d420fa883d4 100644 --- a/src/graph/planner/match/MatchClausePlanner.cpp +++ b/src/graph/planner/match/MatchClausePlanner.cpp @@ -5,21 +5,11 @@ #include "graph/planner/match/MatchClausePlanner.h" -#include "MatchPathPlanner.h" #include "graph/context/ast/CypherAstContext.h" #include "graph/planner/match/MatchPathPlanner.h" -#include "graph/planner/match/MatchSolver.h" -#include "graph/planner/match/PropIndexSeek.h" #include "graph/planner/match/SegmentsConnector.h" -#include "graph/planner/match/StartVidFinder.h" #include "graph/planner/match/WhereClausePlanner.h" -#include "graph/planner/plan/Algo.h" -#include "graph/planner/plan/ExecutionPlan.h" -#include "graph/planner/plan/Logic.h" #include "graph/planner/plan/Query.h" -#include "graph/util/ExpressionUtils.h" -#include "graph/util/SchemaUtil.h" -#include "graph/visitor/RewriteVisitor.h" namespace nebula { namespace graph { diff --git a/src/graph/planner/match/MatchClausePlanner.h b/src/graph/planner/match/MatchClausePlanner.h index 725567520a9..e6066be0b74 100644 --- a/src/graph/planner/match/MatchClausePlanner.h +++ b/src/graph/planner/match/MatchClausePlanner.h @@ -28,15 +28,6 @@ class MatchClausePlanner final : public CypherClausePlanner { std::unordered_set& nodeAliasesSeen, SubPlan& matchClausePlan); - Status buildShortestPath(const std::vector& nodeInfos, - std::vector& edgeInfos, - MatchClauseContext* matchClauseCtx, - SubPlan& subplan, - bool single); - - StatusOr> pickTagIndex(MatchClauseContext* matchClauseCtx, - NodeInfo nodeInfo); - private: Expression* initialExpr_{nullptr}; }; diff --git a/src/graph/planner/match/PropIndexSeek.cpp b/src/graph/planner/match/PropIndexSeek.cpp index 5d07c9aefd2..f93f65dac84 100644 --- a/src/graph/planner/match/PropIndexSeek.cpp +++ b/src/graph/planner/match/PropIndexSeek.cpp @@ -115,8 +115,8 @@ StatusOr PropIndexSeek::transformEdge(EdgeContext* edgeCtx) { } bool PropIndexSeek::matchNode(NodeContext* nodeCtx) { - NodeInfo* node = nodeCtx->info; - if (node->labels.size() != 1) { + auto& node = *nodeCtx->info; + if (node.labels.size() != 1) { // TODO multiple tag index seek need the IndexScan support VLOG(2) << "Multiple tag index seek is not supported now."; return false; @@ -128,8 +128,8 @@ bool PropIndexSeek::matchNode(NodeContext* nodeCtx) { filterInWhere = MatchSolver::makeIndexFilter( node.labels.back(), node.alias, nodeCtx->bindFilter, nodeCtx->qctx); } - if (!nodeInfo->labelProps.empty()) { - auto props = nodeInfo->labelProps.back(); + if (!node.labelProps.empty()) { + auto props = node.labelProps.back(); if (props != nullptr) { filterInPattern = MatchSolver::makeIndexFilter(node.labels.back(), props, nodeCtx->qctx); } @@ -137,7 +137,7 @@ bool PropIndexSeek::matchNode(NodeContext* nodeCtx) { Expression* filter = nullptr; if (!filterInPattern && !filterInWhere) { - return {}; + return false; } else if (!filterInPattern) { filter = filterInWhere; } else if (!filterInWhere) { @@ -146,7 +146,11 @@ bool PropIndexSeek::matchNode(NodeContext* nodeCtx) { filter = LogicalExpression::makeAnd(nodeCtx->qctx->objPool(), filterInPattern, filterInWhere); } - return filter; + nodeCtx->scanInfo.filter = filter; + nodeCtx->scanInfo.schemaIds = node.tids; + nodeCtx->scanInfo.schemaNames = node.labels; + + return true; } StatusOr PropIndexSeek::transformNode(NodeContext* nodeCtx) { diff --git a/src/graph/planner/match/PropIndexSeek.h b/src/graph/planner/match/PropIndexSeek.h index 38d90c6f620..821178e1615 100644 --- a/src/graph/planner/match/PropIndexSeek.h +++ b/src/graph/planner/match/PropIndexSeek.h @@ -26,9 +26,6 @@ class PropIndexSeek final : public StartVidFinder { StatusOr transformEdge(EdgeContext* edgeCtx) override; - static folly::Optional buildFilter(MatchClauseContext* matchClauseCtx, - NodeInfo* nodeInfo); - private: PropIndexSeek() = default; }; diff --git a/src/graph/validator/MatchValidator.cpp b/src/graph/validator/MatchValidator.cpp index 98735805be5..f2a9099d501 100644 --- a/src/graph/validator/MatchValidator.cpp +++ b/src/graph/validator/MatchValidator.cpp @@ -471,9 +471,6 @@ Status MatchValidator::validateStepRange(const MatchStepRange *range) const { return Status::SemanticError( "Max hop must be greater equal than min hop: %ld vs. %ld", max, min); } - if (max == std::numeric_limits::max()) { - return Status::SemanticError("Cannot set maximum hop for variable length relationships"); - } return Status::OK(); }