The base class of SortBasedAggregationIterator.
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 AggregateFunction.
An iterator used to evaluate AggregateFunction. 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 memory manager, it spill the map into disk and create a new one. After processed all the input, then merge all the spills together using external sorter, and do sort-based aggregation.
The process has the following step:
The code of this class is organized as follows:
This class is a rough sketch of how to hook Aggregator
into the Aggregation system.
This class is a rough sketch of how to hook Aggregator
into the Aggregation system. It has
the following limitations:
0
.
Utility functions used by the query planner to convert our plan to new aggregation code path.
The base class of SortBasedAggregationIterator. 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.