![]() |
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 249 of file Aggregation.cpp.
Incorporate one input value into the running aggregate.
| x | Input value to add. |
Implements Aggregator.
Definition at line 256 of file Aggregation.cpp.

Return the final aggregate result.
AggValue. Implements Aggregator.
Definition at line 266 of file Aggregation.cpp.
Return the type of the input values accepted by add().
Implements Aggregator.
Definition at line 269 of file Aggregation.cpp.
|
inlineoverridevirtual |
Return the aggregation operator this accumulator implements.
AggregationOperator enum value for this accumulator. Implements Aggregator.
Definition at line 263 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 277 of file Aggregation.cpp.
|
protected |
Number of non-NULL inputs seen so far.
Definition at line 252 of file Aggregation.cpp.
|
protected |
true once the first non-NULL input has been seen
Definition at line 253 of file Aggregation.cpp.
|
protected |
Running sum of all non-NULL input values.
Definition at line 251 of file Aggregation.cpp.