Class AggregatorInfo
java.lang.Object
org.apache.derby.impl.sql.execute.AggregatorInfo
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
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:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) String
This class implements Formatable.(package private) String
(package private) int
(package private) int
(package private) boolean
(package private) int
(package private) ResultDescription
-
Constructor Summary
ConstructorsConstructorDescriptionNiladic constructor for FormattableAggregatorInfo
(String aggregateName, String aggregatorClassName, int inputColNum, int outputColNum, int aggregatorColNum, boolean isDistinct, ResultDescription rd) Consructor -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the aggergate (e.g.Get the name of the class that implements the user aggregator for this class.int
Get the column number for the aggregator column.int
Get the column number for the input (addend) column.int
Get the column number for the output (result) column.Get the result description for the input value to this aggregate.int
Get the formatID which corresponds to this class.boolean
Is the aggergate distinctvoid
Read this object from a stream of stored objects.toString()
Get a string for the objectvoid
Write this object out
-
Field Details
-
aggregateName
String aggregateNameThis 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
String aggregatorClassName -
isDistinct
boolean isDistinct -
rd
-
-
Constructor Details
-
AggregatorInfo
public AggregatorInfo()Niladic constructor for Formattable -
AggregatorInfo
public AggregatorInfo(String aggregateName, 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 Details
-
getAggregateName
Get the name of the aggergate (e.g. MAX)- Returns:
- the aggeregate name
-
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
Get the result description for the input value to this aggregate.- Returns:
- the rd
-
toString
Get a string for the object -
writeExternal
Write this object out- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- write bytes here- Throws:
IOException
- thrown on error
-
readExternal
Read this object from a stream of stored objects.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- read this.- Throws:
IOException
- thrown on errorClassNotFoundException
- thrown on error
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- the formatID of this class
-