|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ execute overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.iapi.sql.execute
Interface ExecAggregator

- All Superinterfaces:
- java.io.Externalizable, org.apache.derby.iapi.services.io.Formatable, java.io.Serializable, org.apache.derby.iapi.services.io.TypedFormat
- public interface ExecAggregator
- extends org.apache.derby.iapi.services.io.Formatable
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.
- An ExecAggregator instance is created using the defined class name.
- Its setup() method is called to define its role (COUNT(*), SUM, etc.).
- Its newAggregator() method may be called any number of times to create new working aggregators as required. These aggregators have the same role and must be created in an initialized state.
- accumlate and merge will be called across these set of aggregators
- One of these aggregators will be used as the final one for obtaining the result
| Method Summary | |
void |
accumulate(org.apache.derby.iapi.types.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. |
org.apache.derby.iapi.types.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(java.lang.String aggregateName)
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 |
setup
public void setup(java.lang.String aggregateName)
- Set's up the aggregate for processing.
accumulate
public void accumulate(org.apache.derby.iapi.types.DataValueDescriptor addend, java.lang.Object ga) throws org.apache.derby.iapi.error.StandardException
- Iteratively accumulates the addend into the aggregator.
Called on each member of the set of values that is being
aggregated.
merge
public void merge(ExecAggregator inputAggregator) throws org.apache.derby.iapi.error.StandardException
- Merges one aggregator into a another aggregator.
Merges two partial aggregates results into a single result.
Needed for:
- parallel aggregation
- vector aggregation (GROUP BY)
- distinct aggregates (e.g. MAX(DISTINCT Col))
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(); }
getResult
public org.apache.derby.iapi.types.DataValueDescriptor getResult() throws org.apache.derby.iapi.error.StandardException
- Produces the result to be returned by the query.
The last processing of the aggregate.
newAggregator
public 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.
didEliminateNulls
public boolean didEliminateNulls()
- Return true if the aggregation eliminated at least one
null from the input data set.
|
|||||||||
| Home >> All >> org >> apache >> derby >> iapi >> sql >> [ execute overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC