Aggregate functions
On this page
Per-group accumulation with cross-process state combine.
interface AggregateFunction
Section titled “interface AggregateFunction”public interface AggregateFunction<S> extends FunctionDescriptorDescription
A VGI aggregate function. State is per-group and accumulates across
update calls; combine merges partial states from parallel
workers; finalize emits the result row per group.
<S> is the per-group state type. Two #combine combine calls
produce a third S; the framework persists the bytes between calls.
Aggregates produce exactly one output column. #outputSchema is
expected to be a single-field schema; the framework resolves that single
FieldVector once per finalize batch and passes it into
#finalize and #finalizeEmpty — implementations cast it to the
concrete vector type they wrote in outputSchema.
Mirrors vgi.AggregateFunction in vgi-go.