-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
push filter down traverse rule #4987
push filter down traverse rule #4987
Conversation
99ca7ba
to
80a990c
Compare
bc8e393
to
f672427
Compare
# When executing query: | ||
# """ | ||
# match (:player{name:"Tony Parker"})-[r]->() where exists(r.likeness) return r, exists({a:12}.a) | ||
# """ | ||
# Then the result should be, in any order, with relax comparison: | ||
# | r | exists({a:12}.a) | | ||
# | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] | true | | ||
# | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] | true | | ||
# | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] | true | | ||
When executing query: |
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.
Ditto
# When executing query: | ||
# """ | ||
# MATCH (:player{name:"Tony Parker"})-[r]->() where exists(r.likeness) return r, exists({a:12}.a) | ||
# """ | ||
# Then the result should be, in any order, with relax comparison: | ||
# | r | exists({a:12}.a) | | ||
# | [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] | true | | ||
# | [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] | true | | ||
# | [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] | true | | ||
When executing query: |
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.
Affected by #4815
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.
This PR has merged, could these comment out tests be enabled ?
@@ -24,6 +24,19 @@ PushFilterDownProjectRule::PushFilterDownProjectRule() { | |||
RuleSet::QueryRules().addRule(this); | |||
} | |||
|
|||
bool PushFilterDownProjectRule::checkColumnExprKind(const Expression* expr) { |
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.
Copied from #4956
|
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.
excellect!
static_cast<const Traverse*>(matched.dependencies[0].dependencies[0].node->node()); | ||
auto step = traverse->stepRange(); | ||
// step == nullptr means one step. | ||
return step == nullptr; |
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.
only support one step tranverse?
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.
For one step, the query looks like:
match (v1)-[e1]->(v2) where e1.likeness > 78
For multi step, the query should be like:
match (v1)-[e1*1..3]->(v2) where all(i in e1 where i.likeness > 78)
The latter is rarely used currently, so just leave it for future.
Which rule? I don't find it. |
They are not the same rule. |
static_cast<const Traverse*>(matched.dependencies[0].dependencies[0].node->node()); | ||
auto step = traverse->stepRange(); | ||
// step == nullptr means one step. | ||
return step == nullptr; |
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.
bool Traverse::isOneStep() {
return !step;
}
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.
ok
auto* tvGroupNode = matched.dependencies[0].dependencies[0].node; | ||
auto* tv = static_cast<graph::Traverse*>(tvGroupNode->node()); | ||
auto& tvColNames = tv->colNames(); | ||
auto& edgeAlias = tvColNames.back(); |
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.
Hard code...?
Maybe this:
const auto& Traverse::getEdgeAlias() const {
return colNames_.back();
}
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.
Hard code...? Maybe this:
const auto& Traverse::getEdgeAlias() const { return colNames.back(); }
Good job
} | ||
|
||
auto* eFilter = tv->eFilter(); | ||
Expression* newEFilter = nullptr; |
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.
eFilter?LogicalExpression::makeAnd(pool, newfilterPicked, eFilter->clone()):newFilterPicked;
36c75e2
to
b90e3dd
Compare
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.
LGTM
b90e3dd
to
a59e35f
Compare
a59e35f
to
78f79aa
Compare
78f79aa
to
db893c8
Compare
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Description:
How do you solve it?
Special notes for your reviewer, ex. impact of this fix, design document, etc:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe: