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

AggregateExpression

AggregateExpression — Unevaluable Expression Container for AggregateFunction

AggregateExpression is an unevaluable expression (i.e. with no support for eval and doGenCode methods) that acts as a container for an AggregateFunction.

AggregateExpression contains the following:

  • AggregateFunction

  • AggregateMode

  • isDistinct flag indicating whether this aggregation is distinct or not (e.g. whether SQL’s DISTINCT keyword was used for the aggregate function)

  • ExprId

AggregateExpression is created when:

Table 1. toString’s Prefixes per AggregateMode
Prefix AggregateMode

partial_

Partial

merge_

PartialMerge

(empty)

Final or Complete

Table 2. AggregateExpression’s Properties
Name Description

canonicalized

AggregateExpression with AggregateFunction expression canonicalized with the special ExprId as 0.

children

AggregateFunction expression (for which AggregateExpression was created).

dataType

DataType of AggregateFunction expression

foldable

Disabled (i.e. false)

nullable

Whether or not AggregateFunction expression is nullable.

references

AttributeSet with the following:

resultAttribute

Attribute that is:

  • AttributeReference when AggregateFunction is itself resolved

  • UnresolvedAttribute otherwise

sql

Requests AggregateFunction to generate SQL output (with isDistinct flag).

toString

Prefix per AggregateMode followed by AggregateFunction‘s toAggString (with isDistinct flag).

赞(0) 打赏
未经允许不得转载:spark技术分享 » AggregateExpression
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

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

支付宝扫一扫打赏

微信扫一扫打赏