Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Feb 15, 2022
1 parent 2645327 commit 0b437ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/graph/executor/algo/SubgraphExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ folly::Future<Status> SubgraphExecutor::execute() {
auto& biDirectEdgeTypes = subgraph->biDirectEdgeTypes();
while (iter->valid()) {
const auto& dst = iter->getEdgeProp("*", nebula::kDst);
if (historyVids_.find(dst) != historyVids_.end()) {
auto findIter = historyVids_.find(dst);
if (findIter != historyVids_.end()) {
if (biDirectEdgeTypes.empty()) {
iter->next();
} else {
Expand All @@ -53,7 +54,7 @@ folly::Future<Status> SubgraphExecutor::execute() {
}
auto type = typeVal.getInt();
if (biDirectEdgeTypes.find(type) != biDirectEdgeTypes.end()) {
if (type < 0 || historyVids_[dst] + 2 == currentStep) {
if (type < 0 || findIter->second + 2 == currentStep) {
iter->erase();
} else {
iter->next();
Expand Down
3 changes: 3 additions & 0 deletions src/graph/executor/query/DataCollectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ Status DataCollectExecutor::collectSubgraph(const std::vector<std::string>& vars
}
edges.emplace_back(std::move(edge));
}
if (vertices.empty() && edges.empty()) {
break;
}
ds.rows.emplace_back(Row({std::move(vertices), std::move(edges)}));
}
}
Expand Down
3 changes: 0 additions & 3 deletions tests/tck/features/subgraph/subgraph.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2021 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
@jmq
Feature: subgraph

Background:
Expand Down Expand Up @@ -326,7 +325,6 @@ Feature: subgraph
| <[vertex2]> | <[edge2]> |
| <[vertex3]> | <[edge3]> |

@jmm
Scenario: two steps in and out edge
When executing query:
"""
Expand Down Expand Up @@ -1059,4 +1057,3 @@ Feature: subgraph
Then the result should be, in any order, with relax comparison:
| nodes | relationships |
| [("Tom")] | [] |
| [] | [] |

0 comments on commit 0b437ff

Please sign in to comment.