Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Apr 22, 2022
1 parent 6e9374a commit 15f6102
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 31 deletions.
10 changes: 0 additions & 10 deletions src/graph/planner/match/MatchClausePlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 0 additions & 9 deletions src/graph/planner/match/MatchClausePlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ class MatchClausePlanner final : public CypherClausePlanner {
std::unordered_set<std::string>& nodeAliasesSeen,
SubPlan& matchClausePlan);

Status buildShortestPath(const std::vector<NodeInfo>& nodeInfos,
std::vector<EdgeInfo>& edgeInfos,
MatchClauseContext* matchClauseCtx,
SubPlan& subplan,
bool single);

StatusOr<std::vector<IndexID>> pickTagIndex(MatchClauseContext* matchClauseCtx,
NodeInfo nodeInfo);

private:
Expression* initialExpr_{nullptr};
};
Expand Down
16 changes: 10 additions & 6 deletions src/graph/planner/match/PropIndexSeek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ StatusOr<SubPlan> 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;
Expand All @@ -128,16 +128,16 @@ 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);
}
}

Expression* filter = nullptr;
if (!filterInPattern && !filterInWhere) {
return {};
return false;
} else if (!filterInPattern) {
filter = filterInWhere;
} else if (!filterInWhere) {
Expand All @@ -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<SubPlan> PropIndexSeek::transformNode(NodeContext* nodeCtx) {
Expand Down
3 changes: 0 additions & 3 deletions src/graph/planner/match/PropIndexSeek.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class PropIndexSeek final : public StartVidFinder {

StatusOr<SubPlan> transformEdge(EdgeContext* edgeCtx) override;

static folly::Optional<Expression*> buildFilter(MatchClauseContext* matchClauseCtx,
NodeInfo* nodeInfo);

private:
PropIndexSeek() = default;
};
Expand Down
3 changes: 0 additions & 3 deletions src/graph/validator/MatchValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<size_t>::max()) {
return Status::SemanticError("Cannot set maximum hop for variable length relationships");
}
return Status::OK();
}

Expand Down

0 comments on commit 15f6102

Please sign in to comment.