AggregateProcessor
AggregateProcessor
is created and used exclusively when WindowExec
physical operator is executed.
AggregateProcessor
supports DeclarativeAggregate and ImperativeAggregate aggregate functions only (which happen to be AggregateFunction in AggregateExpression or AggregateWindowFunction).
Name | Description |
---|---|
|
initialize
Method
1 2 3 4 5 |
initialize(size: Int): Unit |
Caution
|
FIXME |
Note
|
|
evaluate
Method
1 2 3 4 5 |
evaluate(target: InternalRow): Unit |
Caution
|
FIXME |
Note
|
evaluate is used when…FIXME
|
apply
Factory Method
1 2 3 4 5 6 7 8 9 |
apply( functions: Array[Expression], ordinal: Int, inputAttributes: Seq[Attribute], newMutableProjection: (Seq[Expression], Seq[Attribute]) => MutableProjection): AggregateProcessor |
Note
|
apply is used exclusively when WindowExec is executed (and creates WindowFunctionFrame per AGGREGATE window aggregate functions, i.e. AggregateExpression or AggregateWindowFunction)
|
Executing update on ImperativeAggregates — update
Method
1 2 3 4 5 |
update(input: InternalRow): Unit |
update
executes the update method on every input ImperativeAggregate sequentially (one by one).
Internally, update
joins buffer with input
internal binary row and converts the joined InternalRow
using the MutableProjection function.
update
then requests every ImperativeAggregate to update passing in the buffer and the input input
rows.
Note
|
MutableProjection mutates the same underlying binary row object each time it is executed.
|
Creating AggregateProcessor Instance
AggregateProcessor
takes the following when created:
-
Schema of the buffer (as a collection of
AttributeReferences
) -
ImperativeAggregate expressions for aggregate functions