Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class AggregatorInfo

extends Object
implements Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Imports
org.apache.derby.iapi.sql.ResultDescription, org.apache.derby.iapi.services.io.StoredFormatIds, .FormatIdUtil, .Formatable, org.apache.derby.shared.common.sanity.SanityManager, java.io.ObjectOutput, .ObjectInput, .IOException

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.

Field Summary

Modifier and TypeField and Description
pack-priv String
aggregateName

This class implements Formatable.

pack-priv String
pack-priv int
pack-priv int
pack-priv boolean
pack-priv int
pack-priv ResultDescription

Constructor Summary

AccessConstructor and Description
public
AggregatorInfo()

Niladic constructor for Formattable

public
AggregatorInfo(String
the name of the aggregate. Not actually used anywhere except diagnostics. Should be the names as found in the language (e.g. MAX).
aggregateName
,
String
the name of the aggregator used to process this aggregate. Aggregator expected to have a null arg constructor and implement Aggregator.
aggregatorClassName
,
int
the input column number
inputColNum
,
int
the output column number
outputColNum
,
int
the column number in which the aggregator is stored.
aggregatorColNum
,
boolean
if it is a distinct aggregate
isDistinct
,
ResultDescription
the result description
rd
)

Consructor

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the aggeregate name
getAggregateName
()

Get the name of the aggergate (e.g. MAX)

public String

Returns:

the aggeregator class name
getAggregatorClassName
()

Get the name of the class that implements the user aggregator for this class.

public int

Returns:

the aggeregator colid
getAggregatorColNum
()

Get the column number for the aggregator column.

public int

Returns:

the aggeregator colid
getInputColNum
()

Get the column number for the input (addend) column.

public int

Returns:

the aggeregator colid
getOutputColNum
()

Get the column number for the output (result) column.

public ResultDescription

Returns:

the rd
getResultDescription
()

Get the result description for the input value to this aggregate.

public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

public boolean

Returns:

whether it is distinct
isDistinct
()

Is the aggergate distinct

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public String

Returns:

string
toString
()

Overrides java.lang.Object.toString.

Get a string for the object

public void
writeExternal(ObjectOutput
write bytes here
out
)

Implements java.io.Externalizable.writeExternal.

Write this object out

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

aggregateNameback to summary
pack-priv 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.

aggregatorClassNameback to summary
pack-priv String aggregatorClassName
aggregatorColumnback to summary
pack-priv int aggregatorColumn
inputColumnback to summary
pack-priv int inputColumn
isDistinctback to summary
pack-priv boolean isDistinct
outputColumnback to summary
pack-priv int outputColumn
rdback to summary
pack-priv ResultDescription rd

Constructor Detail

AggregatorInfoback to summary
public AggregatorInfo()

Niladic constructor for Formattable

AggregatorInfoback to summary
public AggregatorInfo(String aggregateName, String aggregatorClassName, int inputColNum, int outputColNum, int aggregatorColNum, boolean isDistinct, ResultDescription rd)

Consructor

Parameters
aggregateName:String

the name of the aggregate. Not actually used anywhere except diagnostics. Should be the names as found in the language (e.g. MAX).

aggregatorClassName:String

the name of the aggregator used to process this aggregate. Aggregator expected to have a null arg constructor and implement Aggregator.

inputColNum:int

the input column number

outputColNum:int

the output column number

aggregatorColNum:int

the column number in which the aggregator is stored.

isDistinct:boolean

if it is a distinct aggregate

rd:ResultDescription

the result description

Method Detail

getAggregateNameback to summary
public String getAggregateName()

Get the name of the aggergate (e.g. MAX)

Returns:String

the aggeregate name

getAggregatorClassNameback to summary
public String getAggregatorClassName()

Get the name of the class that implements the user aggregator for this class.

Returns:String

the aggeregator class name

getAggregatorColNumback to summary
public int getAggregatorColNum()

Get the column number for the aggregator column.

Returns:int

the aggeregator colid

getInputColNumback to summary
public int getInputColNum()

Get the column number for the input (addend) column.

Returns:int

the aggeregator colid

getOutputColNumback to summary
public int getOutputColNum()

Get the column number for the output (result) column.

Returns:int

the aggeregator colid

getResultDescriptionback to summary
public ResultDescription getResultDescription()

Get the result description for the input value to this aggregate.

Returns:ResultDescription

the rd

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

isDistinctback to summary
public boolean isDistinct()

Is the aggergate distinct

Returns:boolean

whether it is distinct

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Get a string for the object

Returns:String

string

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this object out

Parameters
out:ObjectOutput

write bytes here

Exceptions
IOException:
thrown on error