Skip to content

Commit

Permalink
fix limit (#5531) (#5532)
Browse files Browse the repository at this point in the history
Co-authored-by: jimingquan <mingquan.ji@vesoft.com>
  • Loading branch information
Sophie-Xie and nevermore3 committed Apr 28, 2023
1 parent dc747b3 commit 5a283c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/graph/executor/algo/AllPathsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ folly::Future<Status> AllPathsExecutor::buildPathMultiJobs() {

if (!paths.empty()) {
time::Duration convertPathTime;
if (paths.size() > limit_) {
paths.resize(limit_);
}
for (auto& path : paths) {
result_.rows.emplace_back(convertNPath2Row(path.first, path.second));
}
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 @@ -244,6 +244,14 @@ Feature: All Path
| <("Tony Parker")-[:like]->("LaMarcus Aldridge")-[:like]->("Tim Duncan")> |
| <("Tony Parker")-[:like]->("LaMarcus Aldridge")-[:like]->("Tony Parker")-[:like]->("Tim Duncan")> |
| <("Tony Parker")-[:like]->("Manu Ginobili")-[:like]->("Tim Duncan")> |
When executing query:
"""
FIND ALL PATH FROM "Tim Duncan" TO "Tony Parker","Spurs" OVER like,serve UPTO 10 STEPS YIELD path as p
| LIMIT 3 | YIELD count(*) AS cnt
"""
Then the result should be, in any order, with relax comparison:
| cnt |
| 3 |

Scenario: [1] ALL PATH REVERSELY
When executing query:
Expand Down

0 comments on commit 5a283c6

Please sign in to comment.