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

feat: Add AggregateRel.ToBuilder() #114

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

EpsilonPrime
Copy link
Member

No description provided.

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.61%. Comparing base (60cc74f) to head (7e1e556).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   63.53%   63.61%   +0.07%     
==========================================
  Files          44       44              
  Lines       10858    10876      +18     
==========================================
+ Hits         6899     6919      +20     
+ Misses       3644     3642       -2     
  Partials      315      315              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jacques-n jacques-n left a comment

Choose a reason for hiding this comment

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

If I use ToBuilder(), how do I then override measures and/or input?

@EpsilonPrime
Copy link
Member Author

If I use ToBuilder(), how do I then override measures and/or input?

Hmm, true. The builder doesn't have a way to get rid of the existing measures. The cleanest way would be to provide a clear method. The builder doesn't have a way to change the input but AggregateRel.Copy allows the input to change. I propose adding:

AggregateRelBuilder.ReplaceInput
AggregateRelBuilder.ClearMeasures
AggregateRelBuilder.ClearGroupings (affects both grouping references and grouping expressions)

@jacques-n
Copy link
Contributor

What about replacing measures? (That's my specific use case.)

@EpsilonPrime
Copy link
Member Author

What about replacing measures? (That's my specific use case.)

If I implement AggregateRelBuilder.ClearMeasures you could first clear them all and then add all of the desired measures (including old ones) next. If you want to directly replace the third measure I could add AggregateRelBuilder.SetMeasure(index int, measure).

@EpsilonPrime
Copy link
Member Author

EpsilonPrime commented Feb 4, 2025

What about replacing measures? (That's my specific use case.)

If I implement AggregateRelBuilder.ClearMeasures you could first clear them all and then add all of the desired measures (including old ones) next. If you want to directly replace the third measure I could add AggregateRelBuilder.SetMeasure(index int, measure).

@jacques-n Is Clear() sufficient for your purposes or would you like SetMeasure() as well?

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