-
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
Fix for empty results when no shards can be found to route to #10152
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…n results for that query Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
changed the title
Fix for subquery in a Reference Query
Fix for empty results when no shards can be found to route to
Apr 28, 2022
…nly primitive Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
requested review from
harshit-gangal,
systay and
frouioui
as code owners
April 28, 2022 08:23
GuptaManan100
commented
Apr 28, 2022
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.
Everything else LGTM!
Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
approved these changes
Apr 29, 2022
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 (Looks Good To Manan)
systay
pushed a commit
to planetscale/vitess
that referenced
this pull request
May 2, 2022
…io#10152) * feat: prevent merging of subqueries if the outer query is a reference Signed-off-by: Manan Gupta <manan@planetscale.com> * test: added tests for subquery with reference Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: send query to any shard incase there are no shards which contain results for that query Signed-off-by: Manan Gupta <manan@planetscale.com> * test: added tests for other subquery cases Signed-off-by: Manan Gupta <manan@planetscale.com> * test: update unit tests to reflect new behaviour Signed-off-by: Andres Taylor <andres@planetscale.com> * feat: handle streaming in routing when no shards are found Signed-off-by: Andres Taylor <andres@planetscale.com> * feat: only use the special no routes handling when the route is the only primitive Signed-off-by: Andres Taylor <andres@planetscale.com>
systay
added a commit
that referenced
this pull request
May 2, 2022
* Fix for empty results when no shards can be found to route to (#10152) * feat: prevent merging of subqueries if the outer query is a reference Signed-off-by: Manan Gupta <manan@planetscale.com> * test: added tests for subquery with reference Signed-off-by: Manan Gupta <manan@planetscale.com> * feat: send query to any shard incase there are no shards which contain results for that query Signed-off-by: Manan Gupta <manan@planetscale.com> * test: added tests for other subquery cases Signed-off-by: Manan Gupta <manan@planetscale.com> * test: update unit tests to reflect new behaviour Signed-off-by: Andres Taylor <andres@planetscale.com> * feat: handle streaming in routing when no shards are found Signed-off-by: Andres Taylor <andres@planetscale.com> * feat: only use the special no routes handling when the route is the only primitive Signed-off-by: Andres Taylor <andres@planetscale.com> * Skip TestSubqueryInReference if the vtgate version is below 14 Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> * Skip TestSubqueryInReference if the vtgate version is below 13 Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Queries that follow the following pattern -
The table
foo
would has a lookup vindex onsome_field
and there are no matching rows forsome_value
. What Vitess would do when no shards could be found to route to is to return an empty result. This is correct for most cases, but not always. The query above would return an empty result instead of a0
.Related Issue(s)
Checklist