TypedImperativeAggregate Expressions¶
TypedImperativeAggregate
is an extension of the ImperativeAggregate abstraction for typed ImperativeAggregates.
Contract¶
Creating Aggregation Buffer¶
createAggregationBuffer(): T
See:
Used when:
Collect
is requested to deserializeTypedImperativeAggregate
is requested to initialize
Deserializing¶
deserialize(
storageFormat: Array[Byte]): T
See:
Used when:
TypedImperativeAggregate
is requested to merge
Interpreted Execution¶
eval(
buffer: T): Any
See:
Used when:
TypedImperativeAggregate
is requested to execute (interpreted mode)
merge¶
merge(
buffer: T,
input: T): T
See:
Used when:
TypedImperativeAggregate
is requested to merge and mergeBuffersObjects
serialize¶
serialize(
buffer: T): Array[Byte]
See:
Used when:
TypedImperativeAggregate
is requested to serializeAggregateBufferInPlace
update¶
update(
buffer: T,
input: InternalRow): T
See:
Used when:
TypedImperativeAggregate
is requested to update
Implementations¶
Interpreted Expression Evaluation¶
eval(
buffer: InternalRow): Any
eval
is part of the Expression abstraction.
eval
extracts the buffer object (for the given InternalRow) and evaluates the result.
Aggregation Buffer Attributes¶
aggBufferAttributes: Seq[AttributeReference]
aggBufferAttributes
is part of the AggregateFunction abstraction.
aggBufferAttributes
is a single AttributeReference:
Name | DataType |
---|---|
buf | BinaryType |
Extracting Buffer Object¶
getBufferObject(
bufferRow: InternalRow): T // (1)!
getBufferObject(
buffer: InternalRow,
offset: Int): T
- Uses the mutableAggBufferOffset as the
offset
getBufferObject
requests the given InternalRow for the value (of type T
) at the given offset
that is of ObjectType type.
getBufferObject
is used when:
TypedImperativeAggregate
is requested to mergeBuffersObjects, update, merge, eval, serializeAggregateBufferInPlace
ObjectType¶
anyObjectType: ObjectType
When created, TypedImperativeAggregate
creates an ObjectType
of a value of Scala AnyRef
type.
The ObjectType
is used in getBufferObject.