DeclarativeAggregate Expression-Based Functions¶
DeclarativeAggregate
is an extension of the AggregateFunction abstraction for Catalyst Expression-based aggregate functions that use Catalyst Expression for evaluation.
DeclarativeAggregate
is an Unevaluable.
Contract¶
evaluateExpression¶
evaluateExpression: Expression
Catalyst Expression to calculate the final value of this aggregate function
Used when:
EliminateAggregateFilter
logical optimization is executedAggregatingAccumulator
is createdAggregationIterator
is requested for the generateResultProjectionHashAggregateExec
physical operator is requested to doProduceWithoutKeys and generateResultFunctionAggregateProcessor
is created
Expressions to Initialize Empty Aggregation Buffers¶
initialValues: Seq[Expression]
Catalyst Expressions to initialize empty aggregation buffers (for the initial values of this aggregate function)
Used when:
EliminateAggregateFilter
logical optimization is executedAggregatingAccumulator
is createdAggregateCodegenSupport
is requested to doProduceWithoutKeysAggregationIterator
is createdHashAggregateExec
physical operator is requested to createHashMap, getEmptyAggregationBufferHashMapGenerator
is createdAggregateProcessor
is created
mergeExpressions¶
mergeExpressions: Seq[Expression]
Catalyst Expressions to...FIXME
updateExpressions¶
updateExpressions: Seq[Expression]
Catalyst Expressions to update the mutable aggregation buffer based on an input row
Used when:
AggregateProcessor
is createdAggregateCodegenSupport
is requested to doConsumeWithoutKeysAggregationIterator
is requested to generateProcessRowAggregatingAccumulator
is createdHashAggregateExec
is requested to doConsumeWithKeys
Implementations¶
- AggregateWindowFunction
- First
- others