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

Refactor aggregation operators #3188

Merged
merged 16 commits into from
Aug 18, 2023

Conversation

noisersup
Copy link
Member

@noisersup noisersup commented Aug 10, 2023

Description

Closes #3129.

Readiness checklist

  • I added/updated unit tests (and they pass).
  • I added/updated integration/compatibility tests (and they pass).
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@noisersup noisersup added the code/chore Code maintenance improvements label Aug 10, 2023
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #3188 (e9ed88e) into main (30dc9fc) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3188      +/-   ##
==========================================
- Coverage   75.75%   75.69%   -0.06%     
==========================================
  Files         396      396              
  Lines       22219    22196      -23     
==========================================
- Hits        16831    16802      -29     
- Misses       4415     4424       +9     
+ Partials      973      970       -3     
Files Changed Coverage Δ
...ernal/handlers/common/aggregations/stages/group.go 82.29% <ø> (-0.06%) ⬇️
...andlers/common/aggregations/operators/operators.go 81.25% <100.00%> (+6.78%) ⬆️
...rnal/handlers/common/aggregations/operators/sum.go 95.94% <100.00%> (+1.66%) ⬆️
...nal/handlers/common/aggregations/operators/type.go 77.41% <100.00%> (-2.59%) ⬇️

... and 2 files with indirect coverage changes

Flag Coverage Δ
hana ?
integration 72.13% <100.00%> (-0.02%) ⬇️
mongodb 5.30% <0.00%> (+<0.01%) ⬆️
pg 65.17% <100.00%> (-0.03%) ⬇️
shard-1 56.88% <77.77%> (+0.10%) ⬆️
shard-2 55.40% <100.00%> (-0.15%) ⬇️
shard-3 56.22% <88.88%> (+0.11%) ⬆️
sqlite 47.37% <77.77%> (+0.10%) ⬆️
unit 24.55% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@noisersup noisersup changed the title Refactor aggregation operators Refactor aggregation operators Aug 15, 2023
@noisersup noisersup marked this pull request as ready for review August 15, 2023 23:18
@noisersup noisersup requested a review from a team as a code owner August 15, 2023 23:18
@noisersup noisersup enabled auto-merge (squash) August 15, 2023 23:18
@noisersup noisersup requested review from a team and chilagrow August 15, 2023 23:22
@chilagrow
Copy link
Member

The second thing to do is to move operator validation from the Process function. Currently we have a lot of validation inside the Process/Accumulate, which is not great as by default we don't return errors on empty collections (because we don't call Process in such scenario).

@noisersup Do we plan to remove validation inside Process/Accumulate in separate PR too? I see you have another PR to address accumulator 🤗

Copy link
Member

@chilagrow chilagrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great seeing so many code removed 💪

@noisersup noisersup requested a review from chilagrow August 16, 2023 13:54
@AlekSi AlekSi requested a review from a team August 17, 2023 13:17
@AlekSi AlekSi requested a review from a team August 17, 2023 13:17
@AlekSi AlekSi added this to the Next milestone Aug 17, 2023
Copy link
Contributor

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@noisersup noisersup merged commit ed077f3 into FerretDB:main Aug 18, 2023
@noisersup noisersup deleted the refactor-aggregation-3129 branch August 18, 2023 07:14
yonarw pushed a commit to yonarw/FerretDB that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Refactor aggregation operators and accumulators
4 participants