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

#GROUPBY and #COUNT is creating duplicate counts #2360

Open
ivakegg opened this issue Apr 29, 2024 · 1 comment · May be fixed by #2388
Open

#GROUPBY and #COUNT is creating duplicate counts #2360

ivakegg opened this issue Apr 29, 2024 · 1 comment · May be fixed by #2388
Assignees

Comments

@ivakegg
Copy link
Collaborator

ivakegg commented Apr 29, 2024

It appears that when we have a groupby on a model field that maps to multiple fields that actually exist in the same record with the same value, then the counts being returned will be double the actual count of records.

@ivakegg
Copy link
Collaborator Author

ivakegg commented Apr 29, 2024

I created a test case that shows the issue in bugfix/groupedModelCounts

@lbschanno lbschanno self-assigned this Apr 30, 2024
lbschanno added a commit that referenced this issue May 14, 2024
When query model mapping is applied to a document before grouping and
aggregating, it is possible for multiple fields to be mapped to the same
root model mapping with the same value, resulting in duplicate
field-value pairings that were incorrectly included in grouping and
aggregation.

Ensure that duplicate field-value pairings are disregarded. Add tests to
verify this and update documentation to include details about how model
mapping affects the #GROUPBY function.

Fixes #2360
@lbschanno lbschanno linked a pull request May 14, 2024 that will close this issue
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 a pull request may close this issue.

2 participants