Skip to content
Query.Farm
Talk with Us

Aggregate functions

On this page

Per-group accumulation with cross-process state combine.

source
public interface AggregateFunction<S> extends FunctionDescriptor

Description

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.