org.apache.derby.impl.sql.execute
Class GenericAggregator

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericAggregator

class GenericAggregator
extends java.lang.Object

Adaptor that sits between execution layer and aggregates.

Author:
jamie

Field Summary
(package private)  AggregatorInfo aggInfo
           
(package private)  int aggregatorColumnId
           
private  ExecAggregator cachedAggregator
           
private  ClassFactory cf
           
private  TemporaryRowHolderResultSet execResultSet
           
private  int inputColumnId
           
private  ResultDescription inputColumnResultDescription
           
private  int resultColumnId
           
private  ExecRow[] rowArray
           
 
Constructor Summary
(package private) GenericAggregator(AggregatorInfo aggInfo, ClassFactory cf)
          Constructor:
 
Method Summary
(package private)  void accumulate(DataValueDescriptor inputColumn, DataValueDescriptor aggregatorColumn)
          Accumulate the aggregate results.
(package private)  void accumulate(ExecRow inputRow, ExecRow accumulateRow)
          Accumulate the aggregate results.
(package private)  void accumulate(java.lang.Object[] inputRow, java.lang.Object[] accumulateRow)
          Accumulate the aggregate results.
(package private)  boolean finish(ExecRow row)
          Get the results of the aggregation and put it in the result column.
(package private)  AggregatorInfo getAggregatorInfo()
           
(package private)  ExecAggregator getAggregatorInstance()
          Get a new instance of the aggregator and initialize it.
(package private)  int getColumnId()
          Return the column id that is being aggregated
(package private)  void initialize(ExecRow row)
          Initialize the aggregator
(package private)  void merge(ExecRow inputRow, ExecRow mergeRow)
          Merge the aggregate results.
(package private)  void merge(java.lang.Object[] inputRow, java.lang.Object[] mergeRow)
          Merge the aggregate results.
(package private)  void merge(Storable aggregatorColumnIn, Storable aggregatorColumnOut)
          Merge two partial aggregations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aggInfo

AggregatorInfo aggInfo

aggregatorColumnId

int aggregatorColumnId

inputColumnId

private int inputColumnId

resultColumnId

private int resultColumnId

inputColumnResultDescription

private ResultDescription inputColumnResultDescription

rowArray

private ExecRow[] rowArray

execResultSet

private TemporaryRowHolderResultSet execResultSet

cf

private final ClassFactory cf

cachedAggregator

private ExecAggregator cachedAggregator
Constructor Detail

GenericAggregator

GenericAggregator(AggregatorInfo aggInfo,
                  ClassFactory cf)
Constructor:

Parameters:
aggInfo - information about the user aggregate
cf - the class factory.
Method Detail

initialize

void initialize(ExecRow row)
          throws StandardException
Initialize the aggregator

Parameters:
row - the row with the aggregator to be initialized
Throws:
StandardException - on error

accumulate

void accumulate(ExecRow inputRow,
                ExecRow accumulateRow)
          throws StandardException
Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters:
inputRow - the row with the input colum
accumulateRow - the row with the aggregator
Throws:
StandardException - on error

accumulate

void accumulate(java.lang.Object[] inputRow,
                java.lang.Object[] accumulateRow)
          throws StandardException
Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters:
inputRow - the row with the input colum
accumulateRow - the row with the aggregator
Throws:
StandardException - on error

accumulate

void accumulate(DataValueDescriptor inputColumn,
                DataValueDescriptor aggregatorColumn)
          throws StandardException
Accumulate the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters:
inputColumn -
aggregatorColumn -
Throws:
StandardException - on error

merge

void merge(ExecRow inputRow,
           ExecRow mergeRow)
     throws StandardException
Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters:
inputRow - the row with the input colum
mergeRow - the row with the aggregator
Throws:
StandardException - on error

merge

void merge(java.lang.Object[] inputRow,
           java.lang.Object[] mergeRow)
     throws StandardException
Merge the aggregate results. This is the guts of the aggregation. We will call the user aggregate on itself to do the aggregation.

Parameters:
inputRow - the row with the input colum
mergeRow - the row with the aggregator
Throws:
StandardException - on error

finish

boolean finish(ExecRow row)
         throws StandardException
Get the results of the aggregation and put it in the result column.

Parameters:
row - the row with the result and the aggregator
Throws:
StandardException - on error

getAggregatorInstance

ExecAggregator getAggregatorInstance()
                               throws StandardException
Get a new instance of the aggregator and initialize it.

Returns:
an exec aggregator
Throws:
StandardException - on error

getColumnId

int getColumnId()
Return the column id that is being aggregated


merge

void merge(Storable aggregatorColumnIn,
           Storable aggregatorColumnOut)
     throws StandardException
Merge two partial aggregations. This is how the sorter merges partial aggregates.

Throws:
StandardException - on error

getAggregatorInfo

AggregatorInfo getAggregatorInfo()


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.