BaseAggregateExec Unary Physical Operators¶
BaseAggregateExec is an extension of the UnaryExecNode abstraction for aggregate unary physical operators.
BaseAggregateExec is a PartitioningPreservingUnaryExecNode physical operator.
Contract¶
Aggregate Attributes¶
Aggregate Attributes
Used when:
AggregateCodegenSupportis requested to doProduceWithoutKeysBaseAggregateExecis requested to verboseStringWithOperatorId, producedAttributes, toSortAggregate
Aggregate Functions¶
Grouping Keys¶
NamedExpressions of the grouping keys
See:
initialInputBufferOffset¶
isStreaming¶
Used when:
BaseAggregateExecis requested to requiredChildDistribution, toSortAggregate
numShufflePartitions¶
Used when:
BaseAggregateExecis requested to requiredChildDistribution, toSortAggregate
Required Child Distribution Expressions¶
Used when:
BaseAggregateExecis requested for the requiredChildDistribution- DisableUnnecessaryBucketedScan physical optimization is executed
Result Expressions¶
NamedExpressions of the result
Implementations¶
PartitioningPreservingUnaryExecNode¶
BaseAggregateExec is an PartitioningPreservingUnaryExecNode.
Detailed Description (with Operator Id)¶
verboseStringWithOperatorId is part of the QueryPlan abstraction.
verboseStringWithOperatorId returns the following text (with the formattedNodeName and the others):
[formattedNodeName]
Input [size]: [output]
Keys [size]: [groupingExpressions]
Functions [size]: [aggregateExpressions]
Aggregate Attributes [size]: [aggregateAttributes]
Results [size]: [resultExpressions]
| Field | Description |
|---|---|
| formattedNodeName | (operatorId) nodeName [codegen id : $id] |
| Input | Output schema of the single child operator |
| Keys | Grouping Keys |
| Functions | Aggregate Functions |
| Aggregate Attributes | Aggregate Attributes |
| Results | Result Expressions |
Required Child Output Distribution¶
requiredChildDistribution is part of the SparkPlan abstraction.
requiredChildDistribution...FIXME
Produced Attributes (Schema)¶
producedAttributes is part of the QueryPlan abstraction.
producedAttributes is the following:
- Aggregate Attributes
- Result Expressions that are not Grouping Keys
- Aggregate Buffer Attributes
- inputAggBufferAttributes without the output attributes of the single child operator
Aggregate Buffer Attributes (Schema)¶
aggregateBufferAttributes is the aggBufferAttributes of the AggregateFunctions of all the Aggregate Functions.
aggregateBufferAttributes is used when:
AggregateCodegenSupportis requested to supportCodegen, doProduceWithoutKeysBaseAggregateExecis requested for the produced attributes
Converting This Node to SortAggregateExec¶
toSortAggregate creates a SortAggregateExec physical operator (for the same arguments and hence to get the same result as this node).
toSortAggregate is used when:
- ReplaceHashWithSortAgg physical optimization is executed (and replaceHashAgg)