Skip to content

AggregationIterators

AggregationIterator is an abstraction of iterators of UnsafeRows.

abstract class AggregationIterator(...)
extends Iterator[UnsafeRow]

From scala.collection.Iterator:

Iterators are data structures that allow to iterate over a sequence of elements. They have a hasNext method for checking if there is a next element available, and a next method which returns the next element and discards it from the iterator.

Implementations

Creating Instance

AggregationIterator takes the following to be created:

Abstract Class

AggregationIterator is an abstract class and cannot be created directly. It is created indirectly for the concrete AggregationIterators.

AggregateModes

When created, AggregationIterator makes sure that there are at most 2 distinct AggregateModes of the AggregateExpressions.

The AggregateModes have to be a subset of the following mode pairs:

  • Partial and PartialMerge
  • Final and Complete

AggregateFunctions

aggregateFunctions: Array[AggregateFunction]

When created, AggregationIterator initializes AggregateFunctions in the aggregateExpressions (with initialInputBufferOffset).

initializeAggregateFunctions

initializeAggregateFunctions(
  expressions: Seq[AggregateExpression],
  startingInputBufferOffset: Int): Array[AggregateFunction]

initializeAggregateFunctions...FIXME

initializeAggregateFunctions is used when:

generateProcessRow

generateProcessRow(
  expressions: Seq[AggregateExpression],
  functions: Seq[AggregateFunction],
  inputAttributes: Seq[Attribute]): (InternalRow, InternalRow) => Unit

generateProcessRow...FIXME

generateProcessRow is used when:

generateOutput

generateOutput: (UnsafeRow, InternalRow) => UnsafeRow

When created, AggregationIterator creates a ResultProjection function.

generateOutput is used when:

generateResultProjection

generateResultProjection(): (UnsafeRow, InternalRow) => UnsafeRow

generateResultProjection...FIXME

initializeBuffer

initializeBuffer(
  buffer: InternalRow): Unit

initializeBuffer...FIXME

initializeBuffer is used when:


Last update: 2021-05-25
Back to top