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

Cosmos: work on Skip/Take, undefined #33935

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Cosmos: work on Skip/Take, undefined #33935

merged 1 commit into from
Jun 11, 2024

Conversation

roji
Copy link
Member

@roji roji commented Jun 8, 2024

This PR is based on top of #33933, review 2nd commit only

Major changes:

  • Make Skip/Take/ElementAt/First/Single work (almost) everywhere, translating to ARRAY_SLICE() within subqueries (where OFFSET/LIMIT isn't supported). For subqueries over bare arrays, we just extract the array and do ARRAY_SLICE() directly, otherwise we convert the subquery to an array via the ARRAY() operator and then compose the function.
  • Support FirstOrDefault/SingleOrDefault by translating to the undefined-coalescing operator (??).
    • Also add EF.Functions.{IsDefined,CoalesceUndefined}

@roji roji requested a review from a team June 8, 2024 22:29
@roji roji enabled auto-merge (squash) June 11, 2024 17:09
@roji roji merged commit 22aec2c into dotnet:main Jun 11, 2024
7 checks passed
@roji roji deleted the CosmosSkipTake branch June 11, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants