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).

results matching ""

    No results matching ""