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.
Overall -> does the feature functionally, good job. I have a few comments with regarding to passing the object, as well as testing this feature.
src/query/interpreter.cpp
Outdated
if (!flags::run_time::GetHopsLimitPartialResults() && (ctx_.hops_limit.has_value() && ctx_.hops_limit.value() < 0)) { | ||
throw QueryException("Query exceeded the maximum number of hops."); | ||
} | ||
|
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.
I think it's better maybe to make an object in the context with the value that's maximum, and the current value, so we can ask the object if the hops limit is in place and if the hops limit is exhausted, rather than modifying this limit in place
src/query/interpreter.cpp
Outdated
// TODO: how to expose metrics when we have hops limit? | ||
const auto hops_limit = EvaluateHopsLimit(evaluator, cypher_query->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.
can you elaborate this question, I don't understand it at the moment?
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.
I think that comment isn't relevant anymore. Something that bothered me before -> should have delete it before review.
continue; | ||
in_edges.emplace_back(edge_type, from_vertex, edge); | ||
expanded_count = static_cast<int64_t>(vertex_->in_edges.size()); | ||
// TODO: a better filter copy |
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.
what is a better filter copy?
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.
That comment isn't placed here by me. Was here before but since I changed this file it looks like I have put it.
I also don't get it, maybe we can delete it.
Quality Gate passedIssues Measures |
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