Finalizer elements
Finalizer elements complete the function pipeline, and output a value or an aggregate.
You can finalize a pipeline with a timevector output element. These are used at the end of a pipeline to return a timevector. This can be useful if you need to use them in another pipeline later on. The two types of output are:
unnest(), which returns a set of(TimestampTZ, DOUBLE PRECISION)pairs.materialize(), which forces the pipeline to materialize atimevector. This blocks any optimizations that lazily materialize atimevector.
Aggregate output elements
These elements take a timevector and run the corresponding aggregate over it to produce a result.. The possible elements are:
average()integral()counter_agg()hyperloglog()stats_agg()sum()num_vals()
An example of an aggregate output using num_vals():
The output for this example:
An example of an aggregate output using stats_agg():
The output for this example: