A duql plugin reducer runs per group in the GroupFold as FoldOp::PLUGIN
DecisionVerified 30 Sep 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.
Context#
A plugin reducer is an AGGREGATE-kind op (column to value) that duql groups must be able to call.
Decision#
The duql GroupFold runs it as FoldOp::PLUGIN. Like collect, it keeps each group's non-null values and calls dftu_op_run_aggregate once per group at finish. A SCALAR return is Float64, because the fold schema is fixed at plan build.
Why#
It fits the existing streaming group fold from the group fold decision.
Rejected options#
Per-group register_state states: they are per plugin and whole-scan. JIT accumulators: they are engine AggOps and not callable functions.
Also found by searching
- calling a plugin aggregate op inside a duql group by, how is it executed per group
- my plugin reducer in a duql group always returns Float64 instead of its own type
- how does duql run a plugin AGGREGATE op for each group
- FoldOp::PLUGIN GroupFold dftu_op_run_aggregate once per group, collect non-null values
- how does a duql plugin reducer run per group, AGGREGATE op in group fold
- dftu_op_run_aggregate called once per group at finish, return type of scalar
- why is a plugin aggregate result Float64 in duql group
- FoldOp::PLUGIN vs register_state per-plugin states or JIT accumulators for group aggregates