feat: Add long alias support for aggregations.#1267
Conversation
a12a29d to
5dcc233
Compare
MarkDuckworth
left a comment
There was a problem hiding this comment.
LGTM other than the test that uses field names longer than 1500-bytes
| String serverAlias = "aggregate_" + aggregationNum++; | ||
| aliasMap.put(serverAlias, aggregateField.getAlias()); | ||
| aggregation.setAlias(serverAlias); | ||
| aggregations.add(aggregation.build()); |
There was a problem hiding this comment.
will the deduplication still work?
There was a problem hiding this comment.
My understanding is:
duplicate aliases are not allowed
duplicate aggregates are allowed
is that right @cherylEnkidu @MarkDuckworth ?
this code uses aggregate_<counter> as alias, so there should not be any duplicate aliases.
also, there's a test named canGetDuplicateAggregations below which currently passes against the emulator.
There was a problem hiding this comment.
ah... it's coming back to me now... I believe we decided to remove duplicate aggregates even though they are allowed to improve performance.
There was a problem hiding this comment.
Done.
Followed what was done in Android. PTAL.
| String serverAlias = "aggregate_" + aggregationNum++; | ||
| aliasMap.put(serverAlias, aggregateField.getAlias()); | ||
| aggregation.setAlias(serverAlias); | ||
| aggregations.add(aggregation.build()); |
|
The CI is expected to fail (uses prod) |
* feat: Add long alias support for aggregations. * address comments. * Better method name and replace hardcoded "count" with "aggregate_0". * Remove duplicate aggregations. * add static import. * Fix tests. All tests pass.
* feat: Add long alias support for aggregations. * address comments. * Better method name and replace hardcoded "count" with "aggregate_0". * Remove duplicate aggregations. * add static import. * Fix tests. All tests pass.
* feat: Add long alias support for aggregations. * address comments. * Better method name and replace hardcoded "count" with "aggregate_0". * Remove duplicate aggregations. * add static import. * Fix tests. All tests pass.
* feat: SUM / AVG (#1218) * feat: SUM / AVG (real files) * Remove aggregate field duplicates (if any). * Clean up and fixes. * Clean up comments, and add Nonnull where possible. * Add more public docs. * More cleanup. * Update hashCode and equals for AggregateQuery. * Address code review comments. more to come. * fix test name. * Better comment. * Fix alias encoding. * Remove TODO. * Revert the way alias is constructed. * Backport test updates. fix format. fix import stmt. * feat: Add long alias support for aggregations. (#1267) * feat: Add long alias support for aggregations. * address comments. * Better method name and replace hardcoded "count" with "aggregate_0". * Remove duplicate aggregations. * add static import. * Fix tests. All tests pass. * Address comments. * Improve the documentation to match strongly typed languages. * Do not use wildcard import. * Do not use wildcard import (2). * Do not use wildcard import (3). * Do not use wildcard import (4). * Fix the javadoc. * Add license header, and remove unused test code. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * better regex. * Add more tests for cursors. --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* feat: SUM / AVG (#1218) * feat: SUM / AVG (real files) * Remove aggregate field duplicates (if any). * Clean up and fixes. * Clean up comments, and add Nonnull where possible. * Add more public docs. * More cleanup. * Update hashCode and equals for AggregateQuery. * Address code review comments. more to come. * fix test name. * Better comment. * Fix alias encoding. * Remove TODO. * Revert the way alias is constructed. * Backport test updates. fix format. fix import stmt. * feat: Add long alias support for aggregations. (#1267) * feat: Add long alias support for aggregations. * address comments. * Better method name and replace hardcoded "count" with "aggregate_0". * Remove duplicate aggregations. * add static import. * Fix tests. All tests pass. * Address comments. * Improve the documentation to match strongly typed languages. * Do not use wildcard import. * Do not use wildcard import (2). * Do not use wildcard import (3). * Do not use wildcard import (4). * Fix the javadoc. * Add license header, and remove unused test code. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * better regex. * Add more tests for cursors. --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
No description provided.