mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-26 12:44:10 +00:00
* perf(promql): introduce the in-process series plan and chunk handover Signed-off-by: discord9 <discord9@163.com> * feat(promql): hand aggregate state between native operators as chunks too Signed-off-by: discord9 <discord9@163.com> * feat(promql): read children as chunks and hand fused outputs over in process Signed-off-by: discord9 <discord9@163.com> * fix(promql): keep the chunk handover's checks and accounting honest Signed-off-by: discord9 <discord9@163.com> * fix(promql): hold a handed-over state to the checks the frame path makes A router that reads chunks applied none of what a router that reads batches applies: it routed state of any kind, layout or grid, and it released the child's charge for a publication while the groups cut from it were still queued, so a retained row was charged for its slice and not for the batch it slices. The chunk path now holds a publication to the declared state - kind, ordered components, grid, field count - and refuses one that differs, with the error the frame path raises for a mismatching batch. The child's charge moves onto every group cut from the publication and travels with the handed value, so a retained row keeps the parent batch charged. State rows gain one constructor for their layout: `StateRowLayout` resolves the field struct, the field count and the grid once per publication and `row` builds the row against them, so a group costs its own encoding, and the grid and no-contribution checks that `state_row_from_frame_row` made now hold for every row rather than being deferred to the consumer. Tests: a held state group outlives the export that produced it; a chunk-fed router keeps the parent batch charged until its row is dropped; a chunk of another state is refused and a duplicated input survives the chunk path as it does the frame path; a state row refuses positions on another grid and a position no field carries. Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com>