Skip to content

Commit

Permalink
feat: add invocation property to AggregateFunction message for specif…
Browse files Browse the repository at this point in the history
…ying distinct vs all (#191)

* feat: add new invocation property to AggregateFunction message
* docs: add AggregateFunction invocation docs

Co-authored-by: James Taylor <james@qack.io>
  • Loading branch information
JamesRTaylor and James Taylor authored May 12, 2022
1 parent 720dbea commit 373b33f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -779,4 +779,16 @@ message AggregateFunction {
repeated SortField sorts = 3;
AggregationPhase phase = 4;
Type output_type = 5;

AggregationInvocation invocation = 6;

enum AggregationInvocation {
AGGREGATION_INVOCATION_UNSPECIFIED = 0;

// Use all values in aggregation calculation
AGGREGATION_INVOCATION_ALL = 1;

// Use only distinct values in aggregation calculation
AGGREGATION_INVOCATION_DISTINCT = 2;
}
}
1 change: 1 addition & 0 deletions site/docs/expressions/aggregate_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Aggregate function signatures contain all the properties defined for [scalar fun
| Maximum set size | Maximum allowed set size as an unsigned integer. | Optional, defaults to unlimited |
| Decomposable | Whether the function can be executed in one or more intermediate steps. Valid options are: `NONE`, `ONE`, `MANY`, describing how intermediate steps can be taken. | Optional, defaults to `NONE` |
| Intermediate Output Type | If the function is decomposable, represents the intermediate output type that is used, if the function is defined as either `ONE` or `MANY` decomposable. Will be a struct in many cases. | Required for `ONE` and `MANY`. |
| Invocation | Whether the function uses all or only distinct values in the aggregation calculation. Valid options are: `ALL`, `DISTINCT`. | Optional, defaults to `ALL` |



Expand Down

0 comments on commit 373b33f

Please sign in to comment.