-
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
Fix extract filter. #4823
Fix extract filter. #4823
Conversation
Please add some unit tests that can cover the modified behavior in |
I didn't reproduce the crash.
|
ent version |
Can this issue be reproduced in the community edition? Bcz you are fixing a visitor rather than a rule that only the enterprise version has. For example, PushFilterDownGetNbrsRule also invoked this visitor. |
Not sure, I guess it will. |
@@ -276,6 +276,7 @@ bool ExtractFilterExprVisitor::visitLogicalOr(LogicalExpression *expr) { | |||
if (canNotPushedIndex != -1 || !canBeSplit) { | |||
return false; | |||
} |
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.
Crashed at DCHECK(ok())
in ExprVisitorImpl.cpp:130.
Better to fix else branch:
else {
if (!canBePushed_) {
return false;
}
operands[i]->accept(this);
}
Alternatively, we could do some minor refactoring of this visitor, such as adding additional state variables other than "can" and "cannot" pairs to allow the internal logic to continue.
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
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.
Will lead to test fail.
This reverts commit 671f729.
…o fix/extract-filter
Codecov ReportBase: 76.78% // Head: 76.84% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4823 +/- ##
==========================================
+ Coverage 76.78% 76.84% +0.06%
==========================================
Files 1102 1102
Lines 80953 80974 +21
==========================================
+ Hits 62160 62225 +65
+ Misses 18793 18749 -44
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -276,6 +276,7 @@ bool ExtractFilterExprVisitor::visitLogicalOr(LogicalExpression *expr) { | |||
if (canNotPushedIndex != -1 || !canBeSplit) { | |||
return false; | |||
} | |||
canBePushed_ = true; // reset when the LogicalAnd can be split |
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.
IMHO, this is not a good fix. Just fixed code path, but it's not a natural code logic.
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's only what I can do.
""" | ||
MATCH (v:player{name: 'Tim Duncan'})-[:like]->(t) WHERE ( (1 == 1 AND (NOT is_edge(t))) OR (v.player.name == 'Tim Duncan')) RETURN v.player.name | ||
""" | ||
Then the result should be, in any order: |
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.
Better to find the crash cases in community edition.
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't do that.
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 for now, but need to consider refactoring later.
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Close https://github.com/vesoft-inc/nebula-ent/issues/1551
Description:
It caused by extract filter don't reset ok status when the first logical and expr can be split.
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: