Class GenericAggregator
java.lang.Object
org.apache.derby.impl.sql.execute.GenericAggregator
Adaptor that sits between execution layer and aggregates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AggregatorInfo
(package private) int
private ExecAggregator
private final ClassFactory
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
accumulate
(Object[] inputRow, Object[] accumulateRow) Accumulate the aggregate results.(package private) void
accumulate
(ExecRow inputRow, ExecRow accumulateRow) Accumulate the aggregate results.(package private) void
accumulate
(DataValueDescriptor inputColumn, DataValueDescriptor aggregatorColumn) Accumulate the aggregate results.(package private) boolean
Get the results of the aggregation and put it in the result column.(package private) AggregatorInfo
(package private) ExecAggregator
Get a new instance of the aggregator and initialize it.(package private) int
Return the column id that is being aggregated(package private) DataValueDescriptor
(package private) void
initialize
(ExecRow row) Initialize the aggregator(package private) void
Merge the aggregate results.(package private) void
Merge two partial aggregations.(package private) void
Merge the aggregate results.
-
Field Details
-
aggInfo
-
aggregatorColumnId
int aggregatorColumnId -
inputColumnId
private int inputColumnId -
resultColumnId
private int resultColumnId -
cf
-
cachedAggregator
-
-
Constructor Details
-
GenericAggregator
GenericAggregator(AggregatorInfo aggInfo, ClassFactory cf) Constructor:- Parameters:
aggInfo
- information about the user aggregatecf
- the class factory.
-
-
Method Details
-
initialize
Initialize the aggregator- Parameters:
row
- the row with the aggregator to be initialized- Throws:
StandardException
- on error
-
accumulate
Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.- Parameters:
inputRow
- the row with the input columaccumulateRow
- the row with the aggregator- Throws:
StandardException
- on error
-
accumulate
Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.- Parameters:
inputRow
- the row with the input columaccumulateRow
- the row with the aggregator- Throws:
StandardException
- on error
-
accumulate
void accumulate(DataValueDescriptor inputColumn, DataValueDescriptor aggregatorColumn) throws StandardException Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.- Parameters:
inputColumn
-aggregatorColumn
-- Throws:
StandardException
- on error
-
merge
Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.- Parameters:
inputRow
- the row with the input colummergeRow
- the row with the aggregator- Throws:
StandardException
- on error
-
merge
Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.- Parameters:
inputRow
- the row with the input colummergeRow
- the row with the aggregator- Throws:
StandardException
- on error
-
finish
Get the results of the aggregation and put it in the result column.- Parameters:
row
- the row with the result and the aggregator- Throws:
StandardException
- on error
-
getAggregatorInstance
Get a new instance of the aggregator and initialize it.- Returns:
- an exec aggregator
- Throws:
StandardException
- on error
-
getColumnId
int getColumnId()Return the column id that is being aggregated -
getInputColumnValue
- Throws:
StandardException
-
merge
Merge two partial aggregations. This is how the sorter merges partial aggregates.- Throws:
StandardException
- on error
-
getAggregatorInfo
AggregatorInfo getAggregatorInfo()
-