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

DOC-2387-reduce-operation-between-group-by-accums-should-require-same-field-names-4-2 #235

Open
wants to merge 3 commits into
base: 4.2.0-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/querying/pages/accumulators.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,12 @@ GroupByAccum<type [, type]* , accumType [, accumType]* >
In the EBNF above, the *type* terms form the key set, and the *accumType* terms form the map's value. Since they are accumulators, they perform a grouping. Like a MapAccum, if we try to store a (key->value) whose key has already been used, then the new value will accumulate to the data which is already stored.
In this case, each field of the multiple-field value has its own accumulation function. One way to think about GroupByAccum is that each unique key is a group ID.


==== Known Issue

* Currently, operations between different GroupByAccums with the same data types but different field names are not supported. These queries may pass semantic checks but will fail during query compilation with a Type Check Error.


In GroupByAccum, the key types can be base type or tuple. The accumulators are used for aggregating group values. Each accumulator type can be any type including HeapAccum. Each base type and each accumulator type must be followed an alias. Below is an example declaration.

[source,gsql]
Expand Down