Skip to content
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

Query: Implement First/Single/Last OrDefault throwing behavior #15559

Closed
smitpatel opened this issue May 2, 2019 · 2 comments
Closed

Query: Implement First/Single/Last OrDefault throwing behavior #15559

smitpatel opened this issue May 2, 2019 · 2 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@smitpatel
Copy link
Contributor

As per design.

@smitpatel
Copy link
Contributor Author

IMG_20181120_151238

smitpatel added a commit that referenced this issue Jun 4, 2019
In future we need to detect cases when it is used inside subquery to not throw but currently all such tests are disabled because it was doing client eval in previous pipeline

Part of #15559
Resolves #15866
@smitpatel
Copy link
Contributor Author

smitpatel commented Jun 4, 2019

Since for Single(OrDefault) we want to throw exception but we want to treat it as FirstOrDefault in subquery (thanks to @maumar), we can swap out all Single to First except from top level in advance.
We know when we are visiting subquery while translating. We can insert top 1 or 2 based on subquery mode.

smitpatel added a commit that referenced this issue Jun 4, 2019
In future we need to detect cases when it is used inside subquery to not throw but currently all such tests are disabled because it was doing client eval in previous pipeline

Part of #15559
Resolves #15866
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Jun 28, 2019
@smitpatel smitpatel removed their assignment Aug 7, 2019
smitpatel added a commit that referenced this issue Aug 20, 2019
Subquery produces top(1) for Single/SingleOrDefault
Single/First/SingleOrDefault in subquery is treated as if FirstOrDefault
Last/LastOrDefault throws when there is no ordering on SelectExpression to reverse
Resolves #15559
@smitpatel smitpatel self-assigned this Aug 20, 2019
@smitpatel smitpatel added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed poachable punted-for-3.0 labels Aug 20, 2019
@smitpatel smitpatel modified the milestones: Backlog, 3.0.0 Aug 20, 2019
smitpatel added a commit that referenced this issue Aug 20, 2019
Subquery produces top(1) for Single/SingleOrDefault
Single/First/SingleOrDefault in subquery is treated as if FirstOrDefault
Last/LastOrDefault throws when there is no ordering on SelectExpression to reverse
Resolves #15559
smitpatel added a commit that referenced this issue Aug 21, 2019
Subquery produces top(1) for Single/SingleOrDefault
Single/First/SingleOrDefault in subquery is treated as if FirstOrDefault
Last/LastOrDefault throws when there is no ordering on SelectExpression to reverse
Resolves #15559
smitpatel added a commit that referenced this issue Aug 21, 2019
Subquery produces top(1) for Single/SingleOrDefault
Single/First/SingleOrDefault in subquery is treated as if FirstOrDefault
Last/LastOrDefault throws when there is no ordering on SelectExpression to reverse
Resolves #15559
smitpatel added a commit that referenced this issue Aug 21, 2019
Subquery produces top(1) for Single/SingleOrDefault
Single/First/SingleOrDefault in subquery is treated as if FirstOrDefault
Last/LastOrDefault throws when there is no ordering on SelectExpression to reverse
Resolves #15559
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview9 Aug 21, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview9, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants