Fennel: AggComputer Class Reference (original) (raw)
Abstract base class representing computation of a single aggregate function over a collection of scalar values all having the same group key. More...
#include <[AggComputer.h](AggComputer%5F8h-source.html)>
Inheritance diagram for AggComputer:

| Public Member Functions | |
|---|---|
| AggComputer () | |
| virtual | ~AggComputer () |
| virtual void | setInputAttrIndex (uint iInputAttrIndex) |
| Sets the attribute index from which this computer should read input values in source tuples. | |
| virtual void | clearAccumulator (TupleDatum &accumulatorDatum)=0 |
| Clears an accumulator. | |
| virtual void | updateAccumulator (TupleDatum &accumulatorDatum, TupleData const &inputTuple)=0 |
| Updates an accumulator with a new input tuple. | |
| virtual void | computeOutput (TupleDatum &outputDatum, TupleDatum const &accumulatorDatum)=0 |
| Computes an output based on accumulator state. | |
| virtual void | initAccumulator (TupleDatum &accumulatorDatumDest, TupleData const &inputTuple)=0 |
| Initializes a new accumulator datum from an input tuple. | |
| virtual void | initAccumulator (TupleDatum &accumulatorDatumSrc, TupleDatum &accumulatorDatumDest)=0 |
| Initializes a new accumulator datum from an existing accumulator datum. | |
| virtual void | updateAccumulator (TupleDatum &accumulatorDatumSrc, TupleDatum &accumulatorDatumDest, TupleData const &inputTuple)=0 |
| Computes a new accumulator from an existing accumulator dataum and a new input tuple. | |
| Static Public Member Functions | |
| static AggComputer * | newAggComputer (AggFunction aggFunction, TupleAttributeDescriptor const *pAttrDesc) |
| Virtual constructor. | |
| Protected Attributes | |
| int | iInputAttr |
Detailed Description
Abstract base class representing computation of a single aggregate function over a collection of scalar values all having the same group key.
In order to be used for more complex functions such as AVG which require compound accumulator state, it needs to be extended to allow AggComputer to collaborate with its caller in defining the accumulator tuple. Luckily, Farrago rewrites AVG to SUM/COUNT.
Version:
Id
//open/dev/fennel/exec/AggComputer.h#10
Definition at line 47 of file AggComputer.h.
Constructor & Destructor Documentation
| AggComputer::AggComputer | ( | | ) | [explicit] | | ------------------------ | - | | - | ------------ |
| AggComputer::~AggComputer | ( | | ) | [virtual] | | -------------------------- | - | | - | ----------- |
Member Function Documentation
Virtual constructor.
Parameters:
| aggFunction | function for which to construct a computer |
|---|---|
| pAttrDesc | descriptor for input attribute, or NULL for no input attribute (as in COUNT(*)) |
Definition at line 34 of file AggComputer.cpp.
References AGG_FUNC_COUNT, AGG_FUNC_MAX, AGG_FUNC_MIN, AGG_FUNC_SINGLE_VALUE, AGG_FUNC_SUM, STANDARD_TYPE_DOUBLE, STANDARD_TYPE_INT_16, STANDARD_TYPE_INT_32, STANDARD_TYPE_INT_64, STANDARD_TYPE_INT_8, STANDARD_TYPE_REAL, STANDARD_TYPE_UINT_16, STANDARD_TYPE_UINT_32, STANDARD_TYPE_UINT_64, and STANDARD_TYPE_UINT_8.
Referenced by SortedAggExecStream::newAggComputer(), and LhxAggExecStream::setAggComputers().
| void AggComputer::setInputAttrIndex | ( | uint | iInputAttrIndex | ) | [virtual] |
|---|
| virtual void AggComputer::clearAccumulator | ( | TupleDatum & | accumulatorDatum | ) | [pure virtual] |
|---|
| virtual void AggComputer::updateAccumulator | ( | TupleDatum & | accumulatorDatum, |
|---|---|---|---|
| TupleData const & | inputTuple | ||
| ) | [pure virtual] |
| virtual void AggComputer::computeOutput | ( | TupleDatum & | outputDatum, |
|---|---|---|---|
| TupleDatum const & | accumulatorDatum | ||
| ) | [pure virtual] |
| virtual void AggComputer::initAccumulator | ( | TupleDatum & | accumulatorDatumDest, |
|---|---|---|---|
| TupleData const & | inputTuple | ||
| ) | [pure virtual] |
| virtual void AggComputer::initAccumulator | ( | TupleDatum & | accumulatorDatumSrc, |
|---|---|---|---|
| TupleDatum & | accumulatorDatumDest | ||
| ) | [pure virtual] |
| virtual void AggComputer::updateAccumulator | ( | TupleDatum & | accumulatorDatumSrc, |
|---|---|---|---|
| TupleDatum & | accumulatorDatumDest, | ||
| TupleData const & | inputTuple | ||
| ) | [pure virtual] |
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/exec/AggComputer.h
- /home/pub/open/dev/fennel/exec/AggComputer.cpp
