From cd378b541fa4d234cbeb30892951635e5c462787 Mon Sep 17 00:00:00 2001 From: discord9 <55937128+discord9@users.noreply.github.com> Date: Mon, 19 Oct 2026 15:43:02 +0800 Subject: [PATCH] chore(promql): let an evaluated chunk be cloned `EvaluatedChunk` holds a `Series` and a bool, both cheap to copy behind their existing ownership, so deriving `Clone` costs nothing. A consumer that has to keep the chunk it matched on, or hand the same chunk to two stages, would otherwise have to destructure and rebuild it. Needed by the native tree, whose bound nodes receive chunks by value and reuse them. Signed-off-by: discord9 Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com> --- src/promql/src/evaluated.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/promql/src/evaluated.rs b/src/promql/src/evaluated.rs index 887cdd45702..fd7888c6ae5 100644 --- a/src/promql/src/evaluated.rs +++ b/src/promql/src/evaluated.rs @@ -33,7 +33,7 @@ use datatypes::series::time::{GridRange, TimeAxis}; /// A series closes exactly once, on the chunk that carries `is_last`. A closed prefix is always /// followed by a closing chunk, even when that chunk holds no values, so a consumer can tell /// "nothing more here" from "no more input". -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct EvaluatedChunk { /// The evaluated values, addressed on their absolute grid positions. pub series: Series,