You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide details of the change, and generalize the change in the PR title above.
Testing
Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.
Type of Change
Place an x the applicable box:
Bug fix. Add the issue # below if applicable.
New feature. A non-breaking change which adds functionality.
Other, such as a build process or documentation change.
Notes
Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.
That falls off the end of a non-void function, which is UB — with optimization
on you get whatever happens to be in the return slot, and AggregateQuery's
destructor then runs on it. It's also the desktop path, so as it stands this PR
adds SUM for Android and leaves desktop worse than untouched.
The good news is that the desktop implementation is small. The vendored core
already has everything:
So Aggregate is a matter of building the AggregateField vector with an
alias, calling query_.Aggregate(...), and reading the result back out of the ObjectValue by that alias in AggregateQueryInternal::Get — the existing Get uses the count-specific Get(StatusOr<int64_t>) callback, which won't
serve a sum.
Two details that cost me time: a sum of integers comes back as integer_value and a sum of doubles as double_value, so you need both; and
a missing alias means the aggregation matched nothing rather than summed to
zero.
I have this working on desktop against the Firestore emulator as a downstream
patch. It's desktop-only and doesn't use the AggregateField public shape this
PR introduces, so it isn't a drop-in, but happy to share it if it's useful.
This file contains hidden or 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
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.
#1703
Description
Testing
Type of Change
Place an
xthe applicable box:Notes
Release Notessection ofrelease_build_files/readme.md.