关注 spark技术分享,
撸spark源码 玩spark最佳实践

AggregateFunction Contract — Aggregate Function Expressions

AggregateFunction Contract — Aggregate Function Expressions

AggregateFunction is the contract for Catalyst expressions that represent aggregate functions.

AggregateFunction is used wrapped inside a AggregateExpression (using toAggregateExpression method) when:

Note
Aggregate functions are not foldable, i.e. FIXME
Table 1. AggregateFunction Top-Level Catalyst Expressions
Name Behaviour Examples

DeclarativeAggregate

ImperativeAggregate

TypedAggregateExpression

AggregateFunction Contract

Table 2. AggregateFunction Contract
Method Description

aggBufferSchema

Schema of an aggregation buffer to hold partial aggregate results.

Used mostly in ScalaUDAF and AggregationIterator

aggBufferAttributes

AttributeReferences of an aggregation buffer to hold partial aggregate results.

Used in:

inputAggBufferAttributes

defaultResult

Defaults to None.

Creating AggregateExpression for AggregateFunction — toAggregateExpression Method

  1. Calls the other toAggregateExpression with isDistinct disabled (i.e. false)

toAggregateExpression creates a AggregateExpression for the current AggregateFunction with Complete aggregate mode.

Note

toAggregateExpression is used in:

赞(0) 打赏
未经允许不得转载:spark技术分享 » AggregateFunction Contract — Aggregate Function Expressions
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏