abstract class OrderableAggregator extends SystemAggregator
Modifier and Type | Field and Description |
---|---|
protected DataValueDescriptor |
value |
Constructor and Description |
---|
OrderableAggregator() |
Modifier and Type | Method and Description |
---|---|
DataValueDescriptor |
getResult()
Return the result of the operations that we
have been performing.
|
void |
merge(ExecAggregator addend)
Merges one aggregator into a another aggregator.
|
void |
readExternal(java.io.ObjectInput in) |
void |
setup(ClassFactory cf,
java.lang.String aggregateName,
DataTypeDescriptor returnDataType)
Set's up the aggregate for processing.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out)
Although we are not expected to be persistent per se,
we may be written out by the sorter temporarily.
|
accumulate, accumulate, didEliminateNulls
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
newAggregator
getTypeFormatId
protected DataValueDescriptor value
public void setup(ClassFactory cf, java.lang.String aggregateName, DataTypeDescriptor returnDataType)
ExecAggregator
cf
- 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.public void merge(ExecAggregator addend) throws StandardException
ExecAggregator
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(); }
addend
- the other Aggregator
(input partial aggregate)StandardException
- on errorExecAggregator.merge(org.apache.derby.iapi.sql.execute.ExecAggregator)
public DataValueDescriptor getResult() throws StandardException
StandardException
- on errorpublic java.lang.String toString()
toString
in class SystemAggregator
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
Why would we be called to write ourselves out if we are null? For scalar aggregates, we don't bother setting up the aggregator since we only need a single row. So for a scalar aggregate that needs to go to disk, the aggregator might be null.
writeExternal
in interface java.io.Externalizable
writeExternal
in class SystemAggregator
java.io.IOException
- on errorExternalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class SystemAggregator
java.io.IOException
- on errorjava.lang.ClassNotFoundException
- on errorExternalizable.readExternal(java.io.ObjectInput)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.