Skip to content

Commit e8960b1

Browse files
zzylolclaude
andcommitted
refactor: adopt precompute/query_time vocabulary from #783
Rebasing onto #783 left code added by this branch on the old names (ResidualQueryOperator, query_plan::residual, MaintenanceDagSink, MAINTENANCE_DAG_SCHEMA_VERSION). Apply the same renames, and keep the backend subDAG scheduler deleted as this branch intends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8afaf03 commit e8960b1

11 files changed

Lines changed: 19 additions & 796 deletions

File tree

‎control_plane/src/physical/plan_dot.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ fn query_node_label(node: &QueryPlanNode) -> String {
197197
})
198198
.unwrap_or_else(|_| "Invalid physical DAG".into())
199199
}
200-
QueryPlanNode::Logical { operator, .. } => format!("Logical\n{}", query_time_label(operator)),
200+
QueryPlanNode::Logical { operator, .. } => {
201+
format!("Logical\n{}", query_time_label(operator))
202+
}
201203
QueryPlanNode::Scalar { value } => format!("Scalar\n{value}"),
202204
QueryPlanNode::Binary { operator, .. } => format!("Binary\n{operator:?}"),
203205
QueryPlanNode::ReduceSum { .. } => "ReduceSum".into(),

‎control_plane/src/physical/workload_cost.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ mod tests {
10911091
.all(|entry| entry.nodes.values().any(|node| matches!(
10921092
node,
10931093
crate::query_plan::QueryPlanNode::Logical {
1094-
operator: crate::query_plan::residual::ResidualQueryOperator::CurrentSeries {
1094+
operator: crate::query_plan::query_time::QueryTimeOperator::CurrentSeries {
10951095
readout: asap_types::query_plan::current_series::SeriesReadout::Count,
10961096
..
10971097
},

‎control_plane/src/query_plan.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
mod clickhouse_exact;
55
pub mod physical_values;
6-
pub mod residual;
6+
pub mod query_time;
77

88
pub use asap_types::query_plan::*;
99
#[cfg(test)]

‎control_plane/src/query_plan/physical_values.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use planner_types::{
55
post_asap::BinaryOperator,
66
pre_asap::{AggIntent, ArithmeticOpKind, BinaryOpKind, ColumnRef, CompareOpKind, GroupKeys},
77
};
8-
use residual::{Aggregation, BinaryOperation, Grouping, ResidualQueryOperator as Operation};
8+
use query_time::{Aggregation, BinaryOperation, Grouping, QueryTimeOperator as Operation};
99

1010
fn invalid(error: impl std::fmt::Display) -> QueryPlanError {
1111
QueryPlanError::Invalid(error.to_string())
@@ -132,7 +132,7 @@ pub fn compile(
132132
Some(physical::compile_limit(*n, *offset, &grouping(groups)).map_err(invalid)?)
133133
}
134134
Operation::Temporal { operation } => {
135-
use residual::TemporalOperation as T;
135+
use query_time::TemporalOperation as T;
136136
let intent = match operation {
137137
T::Rate => AggIntent::Rate,
138138
T::Increase => AggIntent::Increase,

‎crates/asap_types/src/executable_plan.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ impl InstalledPostAsapDag {
194194
if self.document.schema_version != PRECOMPUTE_DAG_SCHEMA_VERSION {
195195
return Err("unsupported maintenance DAG document version".into());
196196
}
197-
self.binding
198-
.validate_precompute(&self.document.decode()?)?;
197+
self.binding.validate_precompute(&self.document.decode()?)?;
199198
for sink in self.native_programs.keys() {
200199
self.native_program(*sink)?;
201200
}
@@ -504,7 +503,7 @@ mod tests {
504503
let encoded: serde_json::Value =
505504
serde_json::from_slice(&program.encode().unwrap()).unwrap();
506505
let mut document = OwnedPostAsapDag::from_executable("shared".into(), &dag).unwrap();
507-
document.schema_version = MAINTENANCE_DAG_SCHEMA_VERSION;
506+
document.schema_version = PRECOMPUTE_DAG_SCHEMA_VERSION;
508507
let mut installed = InstalledPostAsapDag {
509508
document,
510509
native_programs: BTreeMap::from([

‎crates/asap_types/src/query_plan.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
pub mod current_series;
99
mod native;
10-
pub mod residual;
10+
pub mod query_time;
1111

1212
use std::collections::{BTreeMap, BTreeSet};
1313

‎crates/asap_types/src/query_plan/native.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl QueryPlanEntry {
1111
match self.nodes.get(&self.root) {
1212
Some(QueryPlanNode::Logical {
1313
operator:
14-
residual::ResidualQueryOperator::CurrentSeries {
14+
query_time::QueryTimeOperator::CurrentSeries {
1515
population,
1616
readout: current_series::SeriesReadout::Snapshot,
1717
},

‎data_plane/src/precompute_engine/native_precompute.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ mod tests {
267267
let definition = asap_types::sds::StoredOutputId(1);
268268
let installed = InstalledPostAsapDag {
269269
document: OwnedPostAsapDag {
270-
schema_version: asap_types::executable_plan::MAINTENANCE_DAG_SCHEMA_VERSION,
270+
schema_version: asap_types::executable_plan::PRECOMPUTE_DAG_SCHEMA_VERSION,
271271
query_id: "shared".into(),
272272
nodes: vec![],
273273
edges: vec![],

0 commit comments

Comments
 (0)