Summary
m4(time, value) returns a group's first, smallest, largest and last points, a mergeable state that rollups store and merge for wider buckets. After Apache IoTDB's time-window M4.
Design
m4(time, value) is an aggregate returning a group's first, smallest, largest and last points as a list of
{time, value} structs in time order, repeats removed (after Apache IoTDB's time-window M4). Ties are broken by fixed
orders (time then value for first and last, value then time for the extremes), so the result doesn't depend on row
order. The points merge: m4 over several groups' points equals m4 over their rows, so the list is also the
aggregate's state, m4(points) merges lists, a rollup stores m4 as a list column, and routing answers wider buckets
by merging stored lists. Columnar group accumulator. IIoT small, hourly points per tag over 30 days: 2.03 s from the
readings (3.5 s with a per-group accumulator), 0.51 s from a 1-minute rollup; min, max, first_value and
last_value alone (no times for the extremes) take 1.76 s.
Open questions and issues
None open.
History
- 2026-10-18: built (#73)
- 2026-10-19: moved from SPEC.md into its own spec.
- 2026-10-19: was spec 23; specs regrouped one per feature, with milestones on the roadmap.