Class AggregatorInfo
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.AggregatorInfo
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,Formatable,TypedFormat
public class AggregatorInfo extends java.lang.Object implements Formatable
This is a simple class used to store the run time information needed to invoke an aggregator. This class is serializable because it is stored with the plan. It is serializable rather than externalizable because it isn't particularly complicated and presumbably we don't need version control on plans.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringaggregateNameThis class implements Formatable.(package private) java.lang.StringaggregatorClassName(package private) intaggregatorColumn(package private) intinputColumn(package private) booleanisDistinct(package private) intoutputColumn(package private) ResultDescriptionrd
-
Constructor Summary
Constructors Constructor Description AggregatorInfo()Niladic constructor for FormattableAggregatorInfo(java.lang.String aggregateName, java.lang.String aggregatorClassName, int inputColNum, int outputColNum, int aggregatorColNum, boolean isDistinct, ResultDescription rd)Consructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAggregateName()Get the name of the aggergate (e.g.java.lang.StringgetAggregatorClassName()Get the name of the class that implements the user aggregator for this class.intgetAggregatorColNum()Get the column number for the aggregator column.intgetInputColNum()Get the column number for the input (addend) column.intgetOutputColNum()Get the column number for the output (result) column.ResultDescriptiongetResultDescription()Get the result description for the input value to this aggregate.intgetTypeFormatId()Get the formatID which corresponds to this class.booleanisDistinct()Is the aggergate distinctvoidreadExternal(java.io.ObjectInput in)Read this object from a stream of stored objects.java.lang.StringtoString()Get a string for the objectvoidwriteExternal(java.io.ObjectOutput out)Write this object out
-
-
-
Field Detail
-
aggregateName
java.lang.String aggregateName
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method. OR, since this is something that is used in stored prepared statements, it is ok to change it if you make sure that stored prepared statements are invalidated across releases.
-
inputColumn
int inputColumn
-
outputColumn
int outputColumn
-
aggregatorColumn
int aggregatorColumn
-
aggregatorClassName
java.lang.String aggregatorClassName
-
isDistinct
boolean isDistinct
-
rd
ResultDescription rd
-
-
Constructor Detail
-
AggregatorInfo
public AggregatorInfo()
Niladic constructor for Formattable
-
AggregatorInfo
public AggregatorInfo(java.lang.String aggregateName, java.lang.String aggregatorClassName, int inputColNum, int outputColNum, int aggregatorColNum, boolean isDistinct, ResultDescription rd)Consructor- Parameters:
aggregateName- the name of the aggregate. Not actually used anywhere except diagnostics. Should be the names as found in the language (e.g. MAX).aggregatorClassName- the name of the aggregator used to process this aggregate. Aggregator expected to have a null arg constructor and implement Aggregator.inputColNum- the input column numberoutputColNum- the output column numberaggregatorColNum- the column number in which the aggregator is stored.isDistinct- if it is a distinct aggregaterd- the result description
-
-
Method Detail
-
getAggregateName
public java.lang.String getAggregateName()
Get the name of the aggergate (e.g. MAX)- Returns:
- the aggeregate name
-
getAggregatorClassName
public java.lang.String getAggregatorClassName()
Get the name of the class that implements the user aggregator for this class.- Returns:
- the aggeregator class name
-
getAggregatorColNum
public int getAggregatorColNum()
Get the column number for the aggregator column.- Returns:
- the aggeregator colid
-
getInputColNum
public int getInputColNum()
Get the column number for the input (addend) column.- Returns:
- the aggeregator colid
-
getOutputColNum
public int getOutputColNum()
Get the column number for the output (result) column.- Returns:
- the aggeregator colid
-
isDistinct
public boolean isDistinct()
Is the aggergate distinct- Returns:
- whether it is distinct
-
getResultDescription
public ResultDescription getResultDescription()
Get the result description for the input value to this aggregate.- Returns:
- the rd
-
toString
public java.lang.String toString()
Get a string for the object- Overrides:
toStringin classjava.lang.Object- Returns:
- string
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this object out- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- write bytes here- Throws:
java.io.IOException- thrown on error
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead this object from a stream of stored objects.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- read this.- Throws:
java.io.IOException- thrown on errorjava.lang.ClassNotFoundException- thrown on error
-
getTypeFormatId
public int getTypeFormatId()
Get the formatID which corresponds to this class.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- the formatID of this class
-
-