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

Aggregate Continuation Tokens #843

Merged
merged 39 commits into from
Oct 31, 2019
Merged

Conversation

bchong95
Copy link
Contributor

Aggregate Continuation Tokens

Description

This change provides continuation token support for aggregate queries. Currently aggregate queries are not preempt-able, since we need to drain all the partial aggregate and emit the final result to the user. We also can't emit an partial aggregate, since the user is expecting a single result and does not want to aggregate the partial aggregates. The solution is to return empty pages with the partial aggregate in the continuation token. Since aggregates are done on a single grouping the continuation token is simply:

{
   "SingleGroupingPartialAggregate": <SingleGroupingPartialAggregate>,
   "SourceContinuationToken": <SourceContinuationToken>
}

Like all continuation token changes we need to be able to serialize the query operator state and resume from it.

A natural follow up item is to support GROUP BY continuation tokens, since it's just multiple groupings.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@bchong95 bchong95 self-assigned this Sep 24, 2019
@sboshra
Copy link
Contributor

sboshra commented Oct 7, 2019

internal abstract class SingleGroupAggregator

CompositeAggregator


Refers to: Microsoft.Azure.Cosmos/src/Query/Core/Aggregation/SingleGroupAggregator.cs:16 in ab86e22. [](commit_id = ab86e22, deletion_comment = False)

sboshra
sboshra previously approved these changes Oct 7, 2019
Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

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

:shipit:

sboshra
sboshra previously approved these changes Oct 28, 2019
Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Contributor

@sboshra sboshra left a comment

Choose a reason for hiding this comment

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

:shipit:

@sboshra sboshra merged commit 932beb9 into master Oct 31, 2019
@sboshra sboshra deleted the users/brchon/AggregateContinuationToken branch October 31, 2019 15:51
ealsur pushed a commit that referenced this pull request Nov 19, 2019
* added continuation token stop and start logic for aggregators

* got continuation token ready

* added preemption to aggregate query

* fixed bug where query finishes in a single continuation

* fixed continuation token double escaping bug

* fixed bug where where min / max / undefined value was getting serialized into a continuation token

* wired up try get state

* resolved iteration comments

* renamed

* fixed tests for aggregates

* dummy commit

* bumped the timeout

* reduced timeout

* dummy commit

* dummy commit

* fixed infinite loop

* aggregates technically can get continuation token (it's a single page always for now)

* forked aggregates into compute and sdk implementations

* fixed build issues

* forked create paths

* fixed cancellation token test

* resolved iteration comments

* resolved iteration comments

* resolved iteration comments

* changed continuation token logic

* more inlined with early exit

* more inlined with early exits
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.

4 participants