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
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ mod tests {
assert!(query.labels.contains("L1"));
}

#[test]
fn test_global_aggregate_parses_with_empty_grouping_labels() {
let query = parse_sql_query(
"SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW()",
)
.expect("global aggregate parses");

assert!(query.labels.is_empty());
}

#[test]
fn test_nested_global_aggregates_parse_with_empty_grouping_labels() {
let query = parse_sql_query(
"SELECT SUM(total) FROM (SELECT SUM(value) AS total FROM cpu_usage WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW())",
)
.expect("nested global aggregates parse");

// Matching and execution may reject nested queries, but parsing retains both layers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[test-coverage] No negative-path test for nested global aggregates

This test only shows that parsing keeps both layers. Nothing asserts that the matcher/planner then rejects the shape with NestedQueryUnsupported, so loosening the n > 1 check in query_info_to_pattern would let these flow into execution with time_info UNUSED and no test would fail. The "may reject" comment also leaves the expected outcome unstated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Fixed in c9bc666. test_nested_global_aggregates_remain_unsupported_by_matcher now parses the nested global aggregate and asserts QueryError::NestedQueryUnsupported, making the accepted parser shape and rejected matcher shape explicit.

assert!(query.labels.is_empty());
assert!(query.subquery.expect("inner query").labels.is_empty());
}

#[test]
fn test_nested_global_aggregates_remain_unsupported_by_matcher() {
check_query(
"SELECT SUM(total) FROM (SELECT SUM(value) AS total FROM cpu_usage WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW())",
vec![],
Some(QueryError::NestedQueryUnsupported),
);
}

#[test]
fn test_pattern_matching() {
let schema = create_test_schema();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,7 @@ impl SQLPatternParser {
}
}

if group_bys.is_empty() {
None
} else {
Some(group_bys)
}
Some(group_bys)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[correctness] Global SUM/COUNT can match a label-keyed CMS via capability fallback (asap-query-engine/src/engines/simple_engine/sql.rs:258)

Global aggregates now reach find_compatible_aggregation with empty grouping_labels, and labels_compatible (capability_matching.rs:157) compares only grouping_labels, never aggregated_labels.

Scenario: the planner plans SELECT job, SUM(value) ... GROUP BY job, giving CountMinSketch(sum) with grouping=[] and aggregated=[job]. An unplanned SELECT SUM(value) FROM data ... has grouping=[], matches that config, and point-queries the empty key, returning ~0 instead of the total. Before this PR these queries were rejected at parse time.

Suggested fix: require aggregated_labels to be empty when the requirement has no grouping labels, or exclude configs with aggregated labels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Fixed in c9bc666. Non-top-k global aggregates now require an exact query configuration instead of capability fallback, so a grouped CMS cannot be selected for an unlabeled scalar query. Added global_aggregate_does_not_fallback_to_grouped_config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[correctness] Global COUNT also matches top-k CountMinSketchWithHeap configs (asap-query-engine/src/engines/simple_engine/sql.rs:258)

Statistic::Count lists CountMinSketchWithHeap as compatible, and cms_family_sub_type_compatible only checks count vs sum mode. Heap configs always have grouping=[].

Scenario: SELECT srcip, COUNT(value) AS c ... GROUP BY srcip ORDER BY c DESC LIMIT 5 (heap: grouping=[], aggregated=[srcip], count) plus an unplanned SELECT COUNT(value) FROM t .... The global COUNT is served by the srcip-keyed heap sketch and returns a bogus empty-key estimate instead of the event count.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Fixed by the same c9bc666 guard: a non-top-k global COUNT cannot capability-match a keyed heap configuration. Exact configurations remain eligible, and existing top-k capability-fallback tests still pass.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[correctness] Subquery path skips the unexpected-SELECT-fields check (sqlpattern_parser.rs:244)

Inner subqueries without GROUP BY now parse, but the subquery branch never runs the DISTINCT/HAVING/QUALIFY check that the flat path applies.

Scenario: SELECT SUM(t) FROM (SELECT SUM(value) AS t FROM x WHERE time BETWEEN ... HAVING SUM(value) > 5) used to be rejected by get_groupbys and now parses with the HAVING dropped. Only the matcher's NestedQueryUnsupported stops it today.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Deferred intentionally: this PR changes parsing only, while nested-query matching and execution remain unsupported. c9bc666 adds a matcher regression asserting NestedQueryUnsupported, so the parsed shape cannot enter execution. Tightening unsupported-clause validation inside nested parsing belongs with the nested-execution work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[efficiency] Global SUM/COUNT plans a full CMS + DeltaSetAggregator for one scalar (asap-planner-rs/src/planner/sql.rs:124)

With zero aggregated labels, the planner allocates a multi-population CountMinSketch (width x depth) plus a key tracker for a population that is always one empty key. When spatial_output is empty, mapping to a single-population operator (Sum, or MinMax for exact) would be much cheaper.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Acknowledged and deferred. This PR is scoped to parser acceptance and safe execution of exact global configurations; choosing a cheaper single-population physical plan is a planner optimization and should be addressed separately.

}
_ => None,
}
Expand Down
1 change: 1 addition & 0 deletions asap-query-engine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RUN mkdir -p asap-query-engine/src/bin \
&& echo "fn main() {}" > asap-query-engine/src/bin/precompute_engine.rs \
&& echo "fn main() {}" > asap-query-engine/src/bin/test_e2e_precompute.rs \
&& echo "fn main() {}" > asap-query-engine/src/bin/bench_precompute_sketch.rs \
&& echo "fn main() {}" > asap-query-engine/src/bin/bench_ingest_sender.rs \
&& echo "fn main() {}" > asap-query-engine/src/bin/e2e_quickstart_resource_test.rs \
&& mkdir -p asap-planner-rs/src && echo "fn main() {}" > asap-planner-rs/src/main.rs \
&& echo "pub fn placeholder() {}" >> asap-planner-rs/src/lib.rs
Expand Down
11 changes: 6 additions & 5 deletions asap-query-engine/src/engines/simple_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,9 @@ impl SimpleEngine {
}
},
None => match value_precompute.get_keys() {
Some(keys) if keys.is_empty() => {
vec![(fallback_key.clone(), fallback_key.clone())]
}
Some(keys) => keys
.into_iter()
.filter_map(|self_key| {
Expand Down Expand Up @@ -3116,11 +3119,9 @@ impl SimpleEngine {
Some(&query_bounds),
)
.into_iter()
// A fully unlabeled result (fallback_key was None and
// the value accumulator has no self-keys) has no
// RangeVectorElement representation -- matches today's
// behavior of producing no sample for this combination.
.filter_map(|(key, value)| key.map(|key| (key, value)))
// A missing store key denotes the single scalar row of
// a global aggregate; represent it with empty labels.
.map(|(key, value)| (key.unwrap_or_else(KeyByLabelValues::new), value))
.collect();

// Rank and truncate to k within this group only -- a
Expand Down
6 changes: 6 additions & 0 deletions asap-query-engine/src/engines/simple_engine/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ impl SimpleEngine {
"No query_config entry for SQL spatio-temporal query. Attempting capability-based matching."
);
let requirements = self.build_query_requirements_sql(match_result, topk);
// A global aggregate has no output grouping labels. Capability
// requirements cannot express whether a candidate is internally
// keyed, so only an exact query configuration can safely serve it.
if topk.is_none() && requirements.grouping_labels.labels.is_empty() {
return None;
}
self.streaming_config
.read()
.unwrap()
Expand Down
91 changes: 73 additions & 18 deletions asap-query-engine/src/tests/sql_pattern_matching_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
mod tests {
use crate::data_model::{
AggregationConfig, AggregationReference, AggregationType, CleanupPolicy, InferenceConfig,
QueryConfig, QueryLanguage, SchemaConfig, StreamingConfig, WindowType,
PrecomputedOutput, QueryConfig, QueryLanguage, SchemaConfig, StreamingConfig, WindowType,
};
use crate::engines::simple_engine::SimpleEngine;
use crate::precompute_operators::sum_accumulator::SumAccumulator;
use crate::stores::simple_map_store::SimpleMapStore;
use crate::stores::Store;
use promql_utilities::data_model::KeyByLabelNames;
use sql_utilities::sqlhelper::{SQLSchema, Table};
use std::collections::{HashMap, HashSet};
Expand All @@ -21,7 +23,11 @@ mod tests {
/// * `template_sql` — the NOW()-based query stored in inference_config
/// * `agg_id` — aggregation id
/// * `window_size_ms` — window size in ms
fn build_sql_engine(template_sql: &str, agg_id: u64, window_size_ms: u64) -> SimpleEngine {
fn build_sql_engine(
template_sql: &str,
agg_id: u64,
window_size_ms: u64,
) -> (SimpleEngine, Arc<SimpleMapStore>) {
// Schema: cpu_usage table
let labels: HashSet<String> = ["L1", "L2", "L3", "L4"]
.iter()
Expand Down Expand Up @@ -52,12 +58,16 @@ mod tests {
aggregation_type: AggregationType::Sum,
aggregation_sub_type: String::new(),
parameters: HashMap::new(),
grouping_labels: KeyByLabelNames::new(
["L1", "L2", "L3", "L4"]
.iter()
.map(|s| s.to_string())
.collect(),
),
grouping_labels: if template_sql.contains("GROUP BY") {
KeyByLabelNames::new(
["L1", "L2", "L3", "L4"]
.iter()
.map(|s| s.to_string())
.collect(),
)
} else {
KeyByLabelNames::empty()
},
aggregated_labels: KeyByLabelNames::empty(),
rollup_labels: KeyByLabelNames::empty(),
original_yaml: String::new(),
Expand All @@ -84,20 +94,21 @@ mod tests {
CleanupPolicy::NoCleanup,
));

SimpleEngine::new(
store,
let engine = SimpleEngine::new(
store.clone(),
inference_config,
streaming_config,
1000,
QueryLanguage::sql,
)
);
(engine, store)
}

#[test]
fn test_temporal_query_matches_now_template() {
// Template in inference_config uses NOW()
let template = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1, L2, L3, L4";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

// Incoming query uses absolute timestamps for the same 10s window
let incoming = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4";
Expand All @@ -115,7 +126,7 @@ mod tests {
fn test_spatiotemporal_query_matches_now_template() {
// SpatioTemporal: same metric, spans multiple intervals, GROUP BY subset of labels
let template = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

let incoming = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1";
let query_time = 1727740810.0_f64;
Expand All @@ -127,12 +138,56 @@ mod tests {
);
}

#[test]
fn global_aggregate_does_not_fallback_to_grouped_config() {
let template = "SELECT L1, SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1";
let (engine, _) = build_sql_engine(template, 1, 10_000);
let query = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10'";

assert!(
engine
.build_query_execution_context_sql(query.to_string(), 1_727_740_810.0)
.is_none(),
"a global aggregate must not use capability fallback to select a grouped config"
);
}

#[test]
fn global_sum_returns_one_unlabeled_result() {
let template =
"SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -2, NOW()) AND NOW()";
let (engine, store) = build_sql_engine(template, 1, 1_000);
let context = engine
.build_query_execution_context_sql(template.to_string(), 1_000_000.0)
.expect("global sum context builds");

// The configured aggregation is global, so each stored window has no label key.
for (start, end, value) in [
(999_998_000, 999_999_000, 3.0),
(999_999_000, 1_000_000_000, 5.0),
] {
store
.insert_precomputed_output(
PrecomputedOutput::new(start, end, None, 1),
Box::new(SumAccumulator::with_sum(value)),
)
.expect("insert global sum window");
}

let results = engine
.execute_query_pipeline(&context, false, false)
.expect("global sum executes");
assert_eq!(results.len(), 1);
assert!(results[0].labels.labels.is_empty());
assert_eq!(results[0].value, 8.0);
}

#[test]
fn test_spatial_query_matches_now_template() {
// Window equals the scrape interval (1s), GROUP BY all labels — classifies
// the same as every other shape: SpatioTemporal.
let template = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW() GROUP BY L1, L2, L3, L4";
let engine = build_sql_engine(template, 1, 1000);
let (engine, _) = build_sql_engine(template, 1, 1000);

let incoming = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -1, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4";
let query_time = 1727740810.0_f64;
Expand All @@ -148,7 +203,7 @@ mod tests {
fn test_temporal_quantile_query_matches_now_template() {
// QUANTILE aggregation, window > scrape interval, GROUP BY all labels
let template = "SELECT QUANTILE(0.95, value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1, L2, L3, L4";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

let incoming = "SELECT QUANTILE(0.95, value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4";
let query_time = 1727740810.0_f64;
Expand All @@ -165,7 +220,7 @@ mod tests {
// Nested SQL (spatial-of-temporal subquery) is unsupported: the matcher rejects
// it with QueryError::NestedQueryUnsupported instead of mis-executing it (#499).
let template = "SELECT SUM(result) FROM (SELECT SUM(value) AS result FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1, L2, L3, L4) GROUP BY L1";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

let incoming = "SELECT SUM(result) FROM (SELECT SUM(value) AS result FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4) GROUP BY L1";
let query_time = 1727740810.0_f64;
Expand All @@ -182,7 +237,7 @@ mod tests {
// Nested SQL with an outer ORDER BY + LIMIT is unsupported for the same reason:
// the matcher rejects it before topk detection ever runs.
let template = "SELECT L1, SUM(result) FROM (SELECT SUM(value) AS result FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1, L2, L3, L4) sub GROUP BY L1";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

let incoming = "SELECT L1, SUM(result) AS rollup FROM (SELECT SUM(value) AS result FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4) sub GROUP BY L1 ORDER BY rollup DESC LIMIT 10";
let query_time = 1727740810.0_f64;
Expand All @@ -198,7 +253,7 @@ mod tests {
fn test_no_match_returns_none() {
// Engine has a SUM template; incoming uses AVG — should never match
let template = "SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1, L2, L3, L4";
let engine = build_sql_engine(template, 1, 10_000);
let (engine, _) = build_sql_engine(template, 1, 10_000);

let incoming = "SELECT AVG(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, '2025-10-01 00:00:10') AND '2025-10-01 00:00:10' GROUP BY L1, L2, L3, L4";
let query_time = 1727740810.0_f64;
Expand Down
12 changes: 6 additions & 6 deletions asap-query-engine/tests/sql_query_support/aggregations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cases:

- name: sum
query: SELECT SUM(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW()
expected: unsupported
expected: supported

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[test-coverage] Newly supported cases don't check result values (applies to all ~30 flipped cases; runner at asap-query-engine/tests/sql_query_support.rs:90)

The runner only checks that an execution context gets built. Nothing ingests data and asserts that global SUM/COUNT/MIN/MAX/QUANTILE/COUNT(DISTINCT) combines all series. If the empty-grouping path returned one row per series or an empty result, every case would still pass. The parser tests only assert labels.is_empty().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Fixed in c9bc666 with global_sum_returns_one_unlabeled_result. It inserts two global SUM windows, executes the full SQL pipeline, and asserts one empty-label row with value 8.0; this catches both duplicate-per-series and empty-result failures.

- name: sum-by-job
query: SELECT job, SUM(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW() GROUP BY job
expected: supported
Expand All @@ -136,7 +136,7 @@ cases:
expected: supported
- name: count
query: SELECT COUNT(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: count-by-job
query: SELECT job, COUNT(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW() GROUP BY job
expected: supported
Expand All @@ -152,13 +152,13 @@ cases:
expected: supported
- name: sum-sum-over-time
query: SELECT SUM(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: sum-without-job-sum-over-time
query: SELECT instance, SUM(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY instance
expected: supported
- name: sum-count-over-time
query: SELECT COUNT(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: sum-by-job-count-over-time
query: SELECT job, COUNT(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY job
expected: supported
Expand All @@ -170,7 +170,7 @@ cases:
expected: supported
- name: min-min-over-time
query: SELECT MIN(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: min-by-job-min-over-time
query: SELECT job, MIN(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY job
expected: supported
Expand All @@ -182,7 +182,7 @@ cases:
expected: supported
- name: max-max-over-time
query: SELECT MAX(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: max-by-job-max-over-time
query: SELECT job, MAX(value) FROM data WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY job
expected: supported
Expand Down
14 changes: 7 additions & 7 deletions asap-query-engine/tests/sql_query_support/basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ cases:
query: SELECT L1, COUNT(DISTINCT L2) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW() GROUP BY L1
expected: supported

# No GROUP BY: the pattern parser rejects an empty GROUP BY.
# No GROUP BY: global aggregates use an empty grouping-label set.
- name: sum_no_group_by
query: SELECT SUM(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: count_no_group_by
query: SELECT COUNT(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: min_no_group_by
query: SELECT MIN(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: max_no_group_by
query: SELECT MAX(value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: quantile_no_group_by
query: SELECT QUANTILE(0.95, value) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: count_distinct_no_group_by
query: SELECT COUNT(DISTINCT L2) FROM cpu_usage WHERE time BETWEEN DATEADD(s, -10, NOW()) AND NOW()
expected: unsupported
expected: supported

# Time-range forms, with GROUP BY
- name: absolute_between_group_by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repetition_delay_ms: 60000
cases:
- name: tumbling-sum
query: SELECT SUM(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: keyed-count
query: SELECT job, COUNT(value) FROM data WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW() GROUP BY job
expected: supported
Expand Down
4 changes: 2 additions & 2 deletions asap-query-engine/tests/sql_query_support/olly-bench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repetition_delay_ms: 60000
cases:
- name: olly-09-sum-memory
query: SELECT SUM(value) FROM backend_process_resident_memory_bytes WHERE time BETWEEN DATEADD(s, -1, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: olly-05-max-over-time-cache-lag
query: SELECT job, instance, MAX(value) FROM cache_refresh_lag_seconds WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY job, instance
expected: supported
Expand All @@ -51,7 +51,7 @@ cases:
expected: supported
- name: olly-21-histogram-quantile-0.95
query: SELECT QUANTILE(0.95, value) FROM order_service_http_request_duration_seconds WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW()
expected: unsupported
expected: supported
- name: olly-23-topk-max-over-time-backlog
query: SELECT job, instance, MAX(value) AS v FROM backend_retry_backlog_depth WHERE time BETWEEN DATEADD(s, -300, NOW()) AND NOW() GROUP BY job, instance ORDER BY v DESC LIMIT 2
expected: supported
Loading
Loading