Skip to content

Commit

Permalink
fix allpath without prop when one step
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Nov 10, 2023
1 parent 8dfb587 commit 7c2b12c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graph/executor/algo/AllPathsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ void AllPathsExecutor::buildOneWayPath(std::vector<NPath*>& paths, bool reverse)
auto iter = emptyPropVertices_.find(emptyPropVertex);
if (iter == emptyPropVertices_.end()) {
emptyPropVids_.emplace_back(dst);
emptyPropVertices_.emplace(emptyPropVertex);
}
emptyPropVertices_.emplace(emptyPropVertex);
result_.rows.emplace_back(std::move(row));
}
}
Expand Down Expand Up @@ -506,8 +506,8 @@ std::vector<Row> AllPathsExecutor::buildOneWayPathFromHashTable(bool reverse) {
auto iter = emptyPropVertices_.find(emptyPropVertex);
if (iter == emptyPropVertices_.end()) {
emptyPropVids_.emplace_back(vid);
emptyPropVertices_.emplace(emptyPropVertex);
}
emptyPropVertices_.emplace(emptyPropVertex);
}
return result;
}
Expand Down
8 changes: 8 additions & 0 deletions tests/tck/features/path/AllPath.feature
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,14 @@ Feature: All Path
| <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> |
| <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"})-[:like@0 {likeness: 90}]->("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> |
| <("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})-[:like@0 {likeness: 90}]->("LaMarcus Aldridge" :player{age: 33, name: "LaMarcus Aldridge"})-[:like@0 {likeness: 75}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> |
When executing query:
"""
FIND ALL PATH WITH PROP FROM "Tim Duncan" TO "Tony Parker" OVER * UPTO 1 STEPS YIELD path as p
"""
Then the result should be, in any order, with relax comparison:
| p |
| <("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"})-[:like@0 {likeness: 95}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> |
| <("Tim Duncan" :player{age: 42, name: "Tim Duncan"} :bachelor{name: "Tim Duncan", speciality: "psychology"})-[:teammate@0 {end_year: 2016, start_year: 2001}]->("Tony Parker" :player{age: 36, name: "Tony Parker"})> |

Scenario: ALL Path constant filter
When executing query:
Expand Down

0 comments on commit 7c2b12c

Please sign in to comment.