AggregateCodegenSupport Physical Operators¶
AggregateCodegenSupport
is an extension of the BaseAggregateExec abstraction for aggregate physical operators that support Whole-Stage Java Code Generation (with produce and consume code execution paths).
AggregateCodegenSupport
is a BlockingOperatorWithCodegen
.
Contract¶
doConsumeWithKeys¶
doConsumeWithKeys(
ctx: CodegenContext,
input: Seq[ExprCode]): String
See:
Used when:
AggregateCodegenSupport
is requested to doConsume
doProduceWithKeys¶
doProduceWithKeys(
ctx: CodegenContext): String
See:
Used when:
AggregateCodegenSupport
is requested to doProduce
needHashTable¶
needHashTable: Boolean
Whether this aggregate operator needs to build a hash table
Aggregate Physical Operator | needHashTable |
---|---|
HashAggregateExec | |
SortAggregateExec | ❌ |
Used when:
AggregateCodegenSupport
is requested to doProduceWithoutKeys
Implementations¶
supportCodegen Flag¶
supportCodegen: Boolean
supportCodegen
is part of the CodegenSupport abstraction.
supportCodegen
is enabled (true
) when all the following hold:
- All
AttributeReference
s in the aggregateBufferAttributes use mutable data types - There are no ImperativeAggregates (among the AggregateFunctions of the AggregateExpressions)
Generating Java Source Code for Produce Path¶
doProduce(
ctx: CodegenContext): String
doProduce
is part of the CodegenSupport abstraction.
doProduce
doProduceWithoutKeys when this aggregate operator uses no grouping keys. Otherwise, doProduce
doProduceWithKeys.
doProduceWithoutKeys¶
doProduceWithoutKeys(
ctx: CodegenContext): String
doProduceWithoutKeys
...FIXME
Generating Java Source Code for Consume Path¶
doConsume(
ctx: CodegenContext,
input: Seq[ExprCode],
row: ExprCode): String
doConsume
is part of the CodegenSupport abstraction.
doConsume
doConsumeWithoutKeys when this aggregate operator uses no grouping keys. Otherwise, doConsume
doConsumeWithKeys.
doConsumeWithoutKeys¶
doConsumeWithoutKeys(
ctx: CodegenContext,
input: Seq[ExprCode]): String
doConsumeWithoutKeys
...FIXME