The base class of SortBasedAggregationIterator and UnsafeHybridAggregationIterator.
A helper trait used to create specialized setter and getter for types supported by org.apache.spark.sql.execution.UnsafeFixedWidthAggregationMap's buffer.
A helper trait used to create specialized setter and getter for types supported by org.apache.spark.sql.execution.UnsafeFixedWidthAggregationMap's buffer. (see UnsafeFixedWidthAggregationMap.supportsAggregationBufferSchema).
An iterator used to evaluate AggregateFunction2.
An iterator used to evaluate AggregateFunction2. It assumes the input rows have been sorted by values of groupingKeyAttributes.
An iterator used to evaluate aggregate functions.
An iterator used to evaluate aggregate functions. It operates on UnsafeRows.
This iterator first uses hash-based aggregation to process input rows. It uses a hash map to store groups and their corresponding aggregation buffers. If we this map cannot allocate memory from org.apache.spark.shuffle.ShuffleMemoryManager, it switches to sort-based aggregation. The process of the switch has the following step:
The code of this class is organized as follows:
Utility functions used by the query planner to convert our plan to new aggregation code path.
The base class of SortBasedAggregationIterator and UnsafeHybridAggregationIterator. It mainly contains two parts: 1. It initializes aggregate functions. 2. It creates two functions,
processRow
andgenerateOutput
based on AggregateMode of its aggregate functions.processRow
is the function to handle an input.generateOutput
is used to generate result.