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

Return the final aggregate result.
AggValue. Implements Aggregator.
Definition at line 207 of file Aggregation.cpp.
Return the type of the input values accepted by add().
Used (via the resultType() default) to report the aggregate's result type; see makeAggregator() for the operators actually built.
Implements Aggregator.
Definition at line 210 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 218 of file Aggregation.cpp.
|
protected |
Number of non-NULL inputs seen so far.
Definition at line 196 of file Aggregation.cpp.
|
protected |
true once the first non-NULL input has been seen
Definition at line 197 of file Aggregation.cpp.
|
protected |
Running sum of all non-NULL input values.
Definition at line 195 of file Aggregation.cpp.