-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit number of hops #1928
base: master
Are you sure you want to change the base?
Limit number of hops #1928
Conversation
This reverts commit b074827.
f13a057
to
b074827
Compare
This reverts commit 0bb0363.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small comment from me in tests and vertex_accessor
int64_t expanded_count = 0; | ||
const auto &edges = direction == EdgeDirection::IN ? vertex_->in_edges : vertex_->out_edges; | ||
if (hops_limit && hops_limit->IsUsed()) { | ||
if (hops_limit->LeftHops() == 0 && static_cast<int64_t>(edges.size()) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this ever be < 0 and fool the condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we can increment by more than 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If everything is correct in the operators, this should not happen. That would mean that the limit has already been reached and we shouldn't end up in the vertex accessor, instead part of the query where expansions are done should have ended.
|
@@ -35,6 +35,13 @@ class VertexAccessor final { | |||
private: | |||
friend class Storage; | |||
|
|||
int64_t HandleExpansionsWithoutEdgeTypes(edge_store &edges, query::HopsLimit *hops_limit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename edges
to result_edges
to be in sync with implementation and emphasize that this is returned value
Description
Syntax:
USING HOPS LIMIT x
PR for hops counting: #1935.
Count (Measure and expose hops back to the user (BFS+DFS+Expand; if an edge is filtered out, it should count as a hop).
How to count hops → each time an edge is “crossed”, it’s counted as a HOP.
NOTE: Different cursor will return different paths due to different implementations. Hops are counted in the same way for every cursor.
[master < Task] PR
Documentation checklist
closes #1374