Fennel: CountStarAggComputer Class Reference (original) (raw)
CountStarAggComputer computes COUNT(*), which counts tuples without regard for null values. More...
#include <[AggComputerImpl.h](AggComputerImpl%5F8h-source.html)>
Inheritance diagram for CountStarAggComputer:

| Public Member Functions | |
|---|---|
| virtual void | clearAccumulator (TupleDatum &accumulatorDatum) |
| Clears an accumulator. | |
| virtual void | updateAccumulator (TupleDatum &accumulatorDatum, TupleData const &inputTuple) |
| Updates an accumulator with a new input tuple. | |
| virtual void | initAccumulator (TupleDatum &accumulatorDatumDest, TupleData const &inputTuple) |
| Initializes a new accumulator datum from an input tuple. | |
| virtual void | initAccumulator (TupleDatum &accumulatorDatumSrc, TupleDatum &accumulatorDatumDest) |
| Initializes a new accumulator datum from an existing accumulator datum. | |
| virtual void | updateAccumulator (TupleDatum &accumulatorDatumSrc, TupleDatum &accumulatorDatumDest, TupleData const &inputTuple) |
| Computes a new accumulator from an existing accumulator dataum and a new input tuple. | |
| virtual void | computeOutput (TupleDatum &outputDatum, TupleDatum const &accumulatorDatum) |
| Computes an output based on accumulator state. | |
| virtual void | setInputAttrIndex (uint iInputAttrIndex) |
| Sets the attribute index from which this computer should read input values in source tuples. | |
| Static Public Member Functions | |
| static AggComputer * | newAggComputer (AggFunction aggFunction, TupleAttributeDescriptor const *pAttrDesc) |
| Virtual constructor. | |
| Protected Member Functions | |
| uint64_t & | interpretDatum (TupleDatum &) |
| void | clearAccumulatorImpl (TupleDatum &accumulatorDatum) |
| void | initAccumulatorImpl (TupleDatum &accumulatorDatum) |
| void | updateAccumulatorImpl (TupleDatum &accumulatorDatum) |
| Protected Attributes | |
| int | iInputAttr |
Detailed Description
CountStarAggComputer computes COUNT(*), which counts tuples without regard for null values.
Definition at line 58 of file AggComputerImpl.h.
Member Function Documentation
| void CountStarAggComputer::clearAccumulator | ( | TupleDatum & | accumulatorDatum | ) | [virtual] |
|---|
| void CountStarAggComputer::updateAccumulator | ( | TupleDatum & | accumulatorDatum, |
|---|---|---|---|
| TupleData const & | inputTuple | ||
| ) | [virtual] |
| void CountStarAggComputer::initAccumulator | ( | TupleDatum & | accumulatorDatumDest, |
|---|---|---|---|
| TupleData const & | inputTuple | ||
| ) | [virtual] |
| void CountStarAggComputer::initAccumulator | ( | TupleDatum & | accumulatorDatumSrc, |
|---|---|---|---|
| TupleDatum & | accumulatorDatumDest | ||
| ) | [virtual] |
Initializes a new accumulator datum from an existing accumulator datum.
Parameters:
| accumulatorDatumSrc | the existing accumulator datum |
|---|---|
| accumulatorDatumDest | the new accumulator datum. Memory needs to be associated with this datum by the caller. |
Implements AggComputer.
Definition at line 149 of file AggComputer.cpp.
References TupleDatum::memCopyFrom().
00152 { 00153 accumulatorDatumDest.memCopyFrom(accumulatorDatumSrc); 00154 }
| void CountStarAggComputer::updateAccumulator | ( | TupleDatum & | accumulatorDatumSrc, |
|---|---|---|---|
| TupleDatum & | accumulatorDatumDest, | ||
| TupleData const & | inputTuple | ||
| ) | [virtual] |
Computes a new accumulator from an existing accumulator dataum and a new input tuple.
Parameters:
| accumulatorDatumSrc | the existing accumulator datum |
|---|---|
| accumulatorDatumDest | the new accumulator datum. memory needs to be associated with this datum by the caller. |
| inputTuple | source for update; no references to this data should be retained after this method returns |
Implements AggComputer.
Definition at line 156 of file AggComputer.cpp.
References TupleDatum::copyFrom(), and CountAggComputer::updateAccumulatorImpl().
00160 {
00161 updateAccumulatorImpl(accumulatorDatumSrc);
00162
00163
00164
00165
00166 accumulatorDatumDest.copyFrom(accumulatorDatumSrc);
00167 }
| uint64_t & CountAggComputer::interpretDatum | ( | TupleDatum & | | ) | [inline, protected, inherited] | | ------------------------------------------------------------------------------------------------ | - | ------------------------------------- | | - | -------------------------------- |
| void CountAggComputer::clearAccumulatorImpl | ( | TupleDatum & | accumulatorDatum | ) | [inline, protected, inherited] |
|---|
| void CountAggComputer::initAccumulatorImpl | ( | TupleDatum & | accumulatorDatum | ) | [inline, protected, inherited] |
|---|
| void CountAggComputer::updateAccumulatorImpl | ( | TupleDatum & | accumulatorDatum | ) | [inline, protected, inherited] |
|---|
| void CountAggComputer::computeOutput | ( | TupleDatum & | outputDatum, |
|---|---|---|---|
| TupleDatum const & | accumulatorDatum | ||
| ) | [virtual, inherited] |
Computes an output based on accumulator state.
Parameters:
| outputDatum | receives reference to computed output in preparation for marshalling result |
|---|---|
| accumulatorDatum | final in-memory accumulator state |
Implements AggComputer.
Definition at line 120 of file AggComputer.cpp.
00123 {
00124
00125 outputDatum = accumulatorDatum;
00126 }
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, inherited] |
|---|
Member Data Documentation
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/exec/AggComputerImpl.h
- /home/pub/open/dev/fennel/exec/AggComputer.cpp
