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(database): Add groupBy after distinct queries (option 2) #20125
Draft
innerdvations
wants to merge
8
commits into
develop
Choose a base branch
from
fix/groupby-after-distinct-queries
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+200
−0
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
innerdvations
added
source: core:database
Source is core/database package
pr: fix
This PR is fixing a bug
labels
Apr 16, 2024
1 task
innerdvations
requested review from
alexandrebodin,
Marc-Roig,
Convly and
Bassel17
April 16, 2024 06:50
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
innerdvations
changed the title
fix(database): Add groupBy after non-join queries (option 2)
fix(database): Add groupBy after distinct queries (option 2)
Apr 16, 2024
Marc-Roig
reviewed
Apr 16, 2024
innerdvations
added
the
flag: don't merge
This PR should not be merged at the moment
label
Apr 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
flag: don't merge
This PR should not be merged at the moment
pr: fix
This PR is fixing a bug
source: core:database
Source is core/database package
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.
Alternative solution: #20124
What does it do?
After performing a query that is supposed to be
distinct
but should actually probably be agroupBy
, we apply the same groupBy on the resultset received, in Node rather than the db query.NOTE: on further review and discussion, this will probably break pagination with a resultset that exceeds the size of one page.
Why is it needed?
Fixes #11892
How to test it?
See the original issue.
A test of
sort
has been added to prevent regressions, but this may have unintended side effects that are not caught by existing tests, so a pretty thorough test of nested populates and queries with joins and distincts that aren't the typical path we use.Related issue(s)/PR(s)
Alternative solution: #20124
Fixes #11892
DX-117