Skip to content

Commit 9624673

Browse files
zzylolclaude
andcommitted
fix(executor): keep the evaluation timestamp on temporal pane merges
A per-series SummaryMerge grouped away the time column, so its native output disagreed with the Planner schema ("native output type differs from Planner output"). Merge by series identity, then attach the run scope's timestamp with scope_timestamp, as per-series SummaryAgg does. Pane build timestamps never reach the merged state. Ported from #569. Regression tests merge 5 one-minute panes for an exact Sum and a KLL quantile, rebuilt at query time and retained with distinct build timestamps, and compare them with one 5-minute build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 346e37f commit 9624673

2 files changed

Lines changed: 405 additions & 0 deletions

File tree

‎crates/executor/src/physical_planner/mod.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,22 @@ fn compile_internal(
551551
continue;
552552
}
553553
}
554+
if matches!(node.payload, Payload::SummaryMerge) && output.time_index.is_some() {
555+
// Pane timestamps describe their individual builds. A merged
556+
// per-series state represents this evaluation's entire window,
557+
// so merge by series identity and attach the execution scope's
558+
// timestamp after merging, as per-series SummaryAgg does.
559+
let merged = bind_operation(node, &schemas)?;
560+
let compact = merged.schema();
561+
let merge_id = helper_id(id, 1);
562+
physical_dag.add(merge_id, inputs, merged)?;
563+
physical_dag.add(
564+
id,
565+
vec![merge_id],
566+
Operator::scope_timestamp(compact, output)?,
567+
)?;
568+
continue;
569+
}
554570
let mut operator = compile_node(node, &schemas)
555571
.map_err(|error| invalid(format!("node {id}: {error}")))?;
556572
if operator.is_counter_evaluation() {

0 commit comments

Comments
 (0)