Files
greptimedb/src
discord9 2f173c58bd feat(promql): add a series frame output to the fused native node
The fused node answers one way: a row table with the grid timestamps, one column per series field
and one per declared tag. That is what a query returns, but a consumer of the native path needs to
tell series and positions apart, and the row shape flattens both away - which series a value belongs
to, and which grid positions that series actually holds.

This adds a second output format, fixed when the plan is built rather than chosen at run time:

  PlainRows    the existing row table, unchanged and still the only one a query reaches
  SeriesFrame  the same evaluated chunks handed over as the unified series frame

The format is part of the plan because it decides the node's output schema, so it takes part in the
node's equality, its EXPLAIN text and its rebuild over new children. A row-table plan prints exactly
what it printed before; a frame plan says so on its own line.

A frame is encoded straight from each evaluated chunk, never by flattening it into rows and packing
it again, so a sparse series keeps its runs and a closing chunk with no position is still one row.
The output keeps one partition per input partition: a frame is not a reason to coalesce, and no
exchange is inserted in either format.

The partial-state output that a complete aggregate reads is a third thing again, and the format does
not reach it. When a node exports partition-local state, the format is `PlainRows` by construction,
`convert` hands every chunk to the fold before any format is consulted, and the EXPLAIN line keeps
its `partial state:` suffix. Nothing in the aggregate path is rewritten to make room for frames.

A tree whose root is not evaluated samples is refused while the plan is built, because aggregate
state is a contribution to a later merge and a scalar has no series to name. So is a frame output
over more than one raw source, which this node does not run in parallel yet.

Signed-off-by: discord9 <discord9@users.noreply.github.com>
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
2026-10-26 14:51:19 +08:00
..