Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ version = "0.1.0"
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", branch = "main" }

[workspace.dependencies]
# Keep Planner frontends, selection, and IR on the same immutable revision.
# Keep Planner frontends, selection, and IR on the same immutable revision (current-series Planner PR).
# Alias upstream asap-types because this workspace also defines asap_types.
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "8a943abcefc009e4265fcea4ac3235245c342d52" }
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "8a943abcefc009e4265fcea4ac3235245c342d52" }
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "8a943abcefc009e4265fcea4ac3235245c342d52" }
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "8a943abcefc009e4265fcea4ac3235245c342d52" }

# Shared external deps (used by 2+ crates)
serde = { version = "1.0", features = ["derive"] }
Expand Down
16 changes: 4 additions & 12 deletions control_plane/src/asap_tier_implement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,21 +258,13 @@ mod tests {
}

#[test]
fn avg_over_time_is_not_yet_realizable_matching_capability_for_today() {
// Avg = Sum / Count needs a cross-policy join implement_tree_in_with
// doesn't build (matches capability_for(&AggIntent::Avg) => None
// on the flat path -- see asap_tier_analysis.rs and lower.rs's
// AggFunc::Avg comment). Use avg_over_time (a range-vector
// function), not bare instant avg(...) -- only the former is
// guaranteed to lower through AggFunc::Avg in this frontend.
fn avg_over_time_realizes_exact_sum_divided_by_count() {
let roots = implement_promql_for_asap_tier("avg_over_time(http_requests_total[5m])")
.expect("parses and implements");
assert_eq!(roots.len(), 1);
assert!(
matches!(roots[0].expr, SummaryExpr::KeepPreAsap(_)),
"Avg has no ASAP-tier realization yet on either path: {:?}",
roots[0].expr,
);
assert!(matches!(roots[0].expr, SummaryExpr::BinaryOp { .. }));
assert!(roots[0].guarantee.as_ref().unwrap().is_exact());
planner_types::post_asap::compile_executable_dag(&roots[0]).unwrap();
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions control_plane/src/clickhouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ pub async fn compile_automatic_clickhouse_workload(
let config = materialize_selected_sql(node, family, query)
.map_err(crate::query_plan::QueryPlanError::Invalid)?;
let binding = MaterializationBinding {
full_window_slide_ms: None,
materialization: config.policy_fingerprint().into(),
output_grouping: PhysicalGrouping::Reduce(config.grouping_labels.names()),
window_ms: config.slide_interval * 1000,
Expand Down Expand Up @@ -599,6 +600,7 @@ fn bind_selected_node(
));
}
Ok(MaterializationBinding {
full_window_slide_ms: None,
materialization: selected.policy_fingerprint().into(),
output_grouping: PhysicalGrouping::Reduce(selected.grouping_labels.names()),
window_ms: selected.slide_interval.saturating_mul(1000),
Expand Down
4 changes: 2 additions & 2 deletions control_plane/src/emit/stage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,7 @@ pub(crate) fn build_backend_aggregation_json(agg: &BackendAggregation) -> JsonVa
match kind {
ExactKind::Sum => "Sum",
ExactKind::Count => "Count",
ExactKind::MinMax => "MinMax",
ExactKind::MinMax | ExactKind::Min => "MinMax",
ExactKind::Increase => "Increase",
ExactKind::Rate => "Rate",
ExactKind::IRate => "IRate",
Expand Down Expand Up @@ -3029,7 +3029,7 @@ pub(crate) fn build_backend_aggregation_json(agg: &BackendAggregation) -> JsonVa
planner_types::post_asap::ExactKind::MinMax,
_
)
) { "max" } else { "" },
) { "max" } else if matches!(&agg.family, planner_types::post_asap::SummaryFamilyType::ExactAggregate(planner_types::post_asap::ExactKind::Min, _)) { "min" } else { "" },
"metric": agg.metric_name,
"labels": {
"grouping": agg.grouping,
Expand Down
Loading
Loading