-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
VReplication: Support for BETWEEN
/NOT BETWEEN
filter in VStream
#17721
Conversation
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17721 +/- ##
==========================================
- Coverage 67.97% 67.45% -0.52%
==========================================
Files 1586 1592 +6
Lines 255195 258145 +2950
==========================================
+ Hits 173468 174142 +674
- Misses 81727 84003 +2276 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Tested this locally using the example local cluster. |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
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 is looking really good. Nice work on this so far!
Can you please look at the TestVStreamPushdownFilters
endtoend test in go/test/endtoend/vreplication/vstream_test.go
? We should add to that (additional test cases) or mimic it. This way we have an end to end test that covers both the copy phase (rowstreamer filtering) and the running phase (vstreamer filtering).
Please let me know if I can be of any help!
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
@beingnoble03 let's update the website docs for this: https://vitess.io/docs/22.0/reference/vreplication/materialize/ (https://github.com/vitessio/website). Also check if we need to update that doc with the newly supported filter predicates since the docs were last updated. |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
I see there is an additional e2e test added now just for the |
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@beingnoble03 I was testing locally and was trying a more complex filter expression and then thought it would be useful to add permanently to the existing ones. So took the liberty of pushing it to the PR. |
Thanks Rohit for the additional unit test. Unit tests for pushdown filters(for the case of |
Sorry, had missed that unit test change. @mattlord since unit tests cover it do we need a new e2e test just for this filter? I would suggest removing the new one that was created in this PR . |
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.
Other than a minor refactor suggestion and the issue about the extra e2e tests being discussed in comments, this looks good.
@@ -570,6 +594,46 @@ func (plan *Plan) appendTupleFilter(values sqlparser.ValTuple, opcode Opcode, co | |||
return nil | |||
} | |||
|
|||
func (plan *Plan) getFromAndToEvalResult(expr *sqlparser.BetweenExpr) (*evalengine.EvalResult, *evalengine.EvalResult, error) { | |||
// From value. | |||
fromVal, ok := expr.From.(*sqlparser.Literal) |
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.
Please extract the two identical code blocks for from
and to
.
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.
done.
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
… between-op-vrep Signed-off-by: Noble Mittal <noblemittal@outlook.com>
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.
Excellent work on this @beingnoble03 !
@mattlord since unit tests cover it do we need a new e2e test just for this filter? I would suggest removing the new one that was created in this PR .
Yeah, now that I look at the new tests... I don't think they really give us anything more than we have with the existing TestVStreamPushdownFilters
test and the new unit tests. @beingnoble03 , I'm sorry, but do you mind keeping the minor refactor you did in the e2e test file and removing the two new tests?
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
@mattlord done. |
Description
This PR adds support for
BETWEEN
filter in VStream.Related Issue(s)
Checklist
Deployment Notes