![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Aggregator implementing AVG; always returns a float result. More...


Public Member Functions | |
| void | add (const AggValue &x) override |
| Incorporate one input value into the running aggregate. | |
| AggregationOperator | op () const override |
| Return the aggregation operator this accumulator implements. | |
| AggValue | finalize () const override |
| Return the final aggregate result. | |
| ValueType | inputType () const override |
Return the type of the input values accepted by add(). | |
| ValueType | resultType () const override |
Return the type of the value returned by finalize(). | |
Public Member Functions inherited from Aggregator | |
| virtual | ~Aggregator ()=default |
Protected Attributes | |
| double | sum = 0 |
| Running sum of all non-NULL input values. | |
| unsigned | count = 0 |
| Number of non-NULL inputs seen so far. | |
| bool | has = false |
true once the first non-NULL input has been seen | |
Aggregator implementing AVG; always returns a float result.
Definition at line 227 of file Aggregation.cpp.
Incorporate one input value into the running aggregate.
| x | Input value to add. |
Implements Aggregator.
Definition at line 234 of file Aggregation.cpp.

Return the final aggregate result.
AggValue. Implements Aggregator.
Definition at line 244 of file Aggregation.cpp.
Return the type of the input values accepted by add().
ValueType of values passed to add(). Implements Aggregator.
Definition at line 247 of file Aggregation.cpp.
|
inlineoverridevirtual |
Return the aggregation operator this accumulator implements.
AggregationOperator enum value for this accumulator. Implements Aggregator.
Definition at line 241 of file Aggregation.cpp.
Return the type of the value returned by finalize().
Defaults to inputType(); override when the result type differs (e.g., AVG returns FLOAT regardless of the input type).
ValueType of the value returned by finalize(). Reimplemented from Aggregator.
Definition at line 255 of file Aggregation.cpp.
|
protected |
Number of non-NULL inputs seen so far.
Definition at line 230 of file Aggregation.cpp.
|
protected |
true once the first non-NULL input has been seen
Definition at line 231 of file Aggregation.cpp.
|
protected |
Running sum of all non-NULL input values.
Definition at line 229 of file Aggregation.cpp.