|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ExecAggregator
An ExecAggregator is the interface that execution uses to an aggregate. System defined aggregates will implement this directly.
The life time of an ExecAggregator is as follows.
| Method Summary | |
|---|---|
void |
accumulate(DataValueDescriptor addend,
java.lang.Object ga)
Iteratively accumulates the addend into the aggregator. |
boolean |
didEliminateNulls()
Return true if the aggregation eliminated at least one null from the input data set. |
DataValueDescriptor |
getResult()
Produces the result to be returned by the query. |
void |
merge(ExecAggregator inputAggregator)
Merges one aggregator into a another aggregator. |
ExecAggregator |
newAggregator()
Return a new initialized copy of this aggregator, any state set by the setup() method of the original Aggregator must be copied into the new aggregator. |
void |
setup(ClassFactory classFactory,
java.lang.String aggregateName,
DataTypeDescriptor returnDataType)
Set's up the aggregate for processing. |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Methods inherited from interface org.apache.derby.iapi.services.io.TypedFormat |
|---|
getTypeFormatId |
| Method Detail |
|---|
void setup(ClassFactory classFactory,
java.lang.String aggregateName,
DataTypeDescriptor returnDataType)
classFactory - Database-specific class factory.aggregateName - For builtin aggregates, this is a SQL aggregate name like MAX. For user-defined aggregates, this is the name of the user-written class which implements org.apache.derby.agg.Aggregator.returnDataType - The type returned by the getResult() method.
void accumulate(DataValueDescriptor addend,
java.lang.Object ga)
throws StandardException
addend - the DataValueDescriptor addend (current input to
the aggregation)ga - a result set getter
StandardException - on error
void merge(ExecAggregator inputAggregator)
throws StandardException
An example of a merge would be: given two COUNT() aggregators, C1 and C2, a merge of C1 into C2 would set C1.count += C2.count. So, given a CountAggregator with a getCount() method that returns its counts, its merge method might look like this:
public void merge(ExecAggregator inputAggregator) throws StandardException
{
count += ((CountAccgregator)inputAggregator).getCount();
}
inputAggregator - the other Aggregator
(input partial aggregate)
StandardException - on error
DataValueDescriptor getResult()
throws StandardException
StandardException - on errorExecAggregator newAggregator()
boolean didEliminateNulls()
|
Built on Wed 2013-06-12 15:21:56+0000, from revision ??? | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||