Files
openobserve/tests/test-data/query-agent/queries/date_time.json
T
Neha PandClaude Opus 4.7 b0f4b0e46f test: expand query-agent suite from 672 to 1,000 queries (#12856)
## Summary

Expands the query-agent regression test suite from **672 → 1,000
queries** by adding 328 complex queries (Q672–Q999) across all 13
categories.

## What changed

- **`data_gen.py`**: `NUM_QUERIES` bumped from 675 → 1000 so
`build_dataset()` generates records for all query IDs
- **13 query JSON files**: 328 new queries appended, with
DuckDB-computed expected results via `compute_counts.py`
- **`gen_q672_q999.py`**: new generation script (idempotent — re-running
skips all existing queries)

## New query patterns added

Targets DataFusion-upgrade-fragile areas identified from past breakage:

| Pattern | Examples |
|---|---|
| 3-stream JOINs + correlated EXISTS | Q672–Q677 |
| FULL OUTER JOIN between streams | Q693–Q696 |
| Window + DISTINCT (FIRST_VALUE, LAST_VALUE, NTH_VALUE) | Q717–Q730 |
| Named WINDOW clauses | Q731–Q736 |
| LAG/LEAD with CASE trend detection | Q742–Q751 |
| match_all + GROUP BY + HAVING | Q792–Q796 |
| INTERSECT/EXCEPT with CTEs | Q822–Q849 |
| Deep CTE chains (3+ CTEs, self-joins) | Q757–Q791 |
| Correlated scalar subqueries in SELECT | Q769–Q776 |
| Histogram with JOIN between streams | Q901–Q905 |

## Issues fixed

- **4 duplicate IDs** (Q545–Q548) existed in both `cte_subquery.json`
and `full_text_search.json` — renumbered FTS copies to available gaps
(Q025, Q611, Q631, Q1000)
- **27 queries** using OO-specific functions (match_all, spath,
regexp_like, window-inside-aggregate) annotated with `skip_sqllogictest:
true`

## Final breakdown

| Category | Before | After |
|---|---|---|
| cte_subquery | 89 | 124 |
| aggregation | 71 | 99 |
| string_functions | 70 | 92 |
| combined | 73 | 88 |
| full_text_search | 58 | 88 |
| window | 48 | 88 |
| basic_select | 71 | 86 |
| histogram | 57 | 79 |
| union | 34 | 62 |
| cross_stream | 16 | 61 |
| date_time | 37 | 60 |
| pagination | 22 | 42 |
| math_functions | 26 | 31 |
| **Total** | **672** | **1,000** |

- **956** queries use sqllogictest mode (DuckDB-verified results)
- **44** use legacy assertion mode (OO-specific functions, histograms)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-24 14:24:11 +00:00

2547 lines
64 KiB
JSON

{
"queries": [
{
"id": "Q063",
"sql": "SELECT histogram(_timestamp, '2 minutes') AS _time, COUNT(*) AS cnt FROM \"{stream}\" GROUP BY _time ORDER BY _time ASC",
"category": "date_time",
"expected": {
"columns": [
"_time",
"cnt"
],
"results": [
[
"2026-06-06T06:58:00",
"10"
],
[
"2026-06-06T07:00:00",
"4"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 3719000000,
"end_offset": 3883000000
}
},
{
"id": "Q064",
"sql": "SELECT histogram(_timestamp, '1 minute') AS ts_minute, operation_mode, COUNT(*) AS cnt FROM \"{stream}\" GROUP BY ts_minute, operation_mode ORDER BY ts_minute ASC, operation_mode ASC",
"category": "date_time",
"expected": {
"columns": [
"ts_minute",
"operation_mode",
"cnt"
],
"results": [
[
"2026-06-06T06:59:00",
"auto",
"2"
],
[
"2026-06-06T06:59:00",
"hybrid",
"1"
],
[
"2026-06-06T06:59:00",
"manual",
"2"
],
[
"2026-06-06T07:00:00",
"auto",
"1"
],
[
"2026-06-06T07:00:00",
"hybrid",
"2"
],
[
"2026-06-06T07:00:00",
"manual",
"2"
],
[
"2026-06-06T07:01:00",
"auto",
"2"
],
[
"2026-06-06T07:01:00",
"manual",
"2"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 3779000000,
"end_offset": 3943000000
}
},
{
"id": "Q065",
"sql": "SELECT _timestamp, pallet_id, facility_zone, log FROM \"{stream}\" ORDER BY _timestamp DESC LIMIT 5",
"category": "date_time",
"expected": {
"columns": [
"pallet_id",
"facility_zone",
"log"
],
"results": [
[
"PL-002",
"ZONE-4",
"Q067 warehouse event record 2"
],
[
"PL-001",
"ZONE-3",
"Q067 warehouse event record 1"
],
[
"PL-007",
"ZONE-1",
"Q066 warehouse event record 4"
],
[
"PL-008",
"ZONE-2",
"Q067 warehouse event record 0 ACK batch batchIdList:Q067-0"
],
[
"PL-006",
"ZONE-4",
"Q066 warehouse event record 3 ACK batch batchIdList:Q066-3"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 3839000000,
"end_offset": 4003000000
}
},
{
"id": "Q066",
"sql": "SELECT histogram(_timestamp, '5 minutes') AS _time, SUM(throughput_rate) AS total_tput, MIN(throughput_rate) AS min_tput, MAX(throughput_rate) AS max_tput FROM \"{stream}\" WHERE throughput_rate IS NOT NULL GROUP BY _time ORDER BY _time ASC",
"category": "date_time",
"expected": {
"columns": [
"_time",
"total_tput",
"min_tput",
"max_tput"
],
"results": [
[
"2026-06-06T07:00:00",
"7240.0",
"150.0",
"900.0"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 3899000000,
"end_offset": 4063000000
}
},
{
"id": "Q067",
"sql": "SELECT histogram(_timestamp, '1 minute') AS minute_bucket, COUNT(*) FILTER (WHERE operation_mode='auto') AS auto_cnt, COUNT(*) FILTER (WHERE operation_mode='manual') AS manual_cnt, COUNT(*) FILTER (WHERE operation_mode='hybrid') AS hybrid_cnt FROM \"{stream}\" GROUP BY minute_bucket ORDER BY minute_bucket ASC",
"category": "date_time",
"expected": {
"columns": [
"minute_bucket",
"auto_cnt",
"manual_cnt",
"hybrid_cnt"
],
"results": [
[
"2026-06-06T07:02:00",
"2",
"2",
"1"
],
[
"2026-06-06T07:03:00",
"2",
"2",
"1"
],
[
"2026-06-06T07:04:00",
"2",
"1",
"1"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 3959000000,
"end_offset": 4123000000
}
},
{
"id": "Q068",
"sql": "SELECT histogram(_timestamp, '30 seconds') AS half_min, facility_zone, COUNT(*) AS cnt, ROUND(AVG(load_factor), 2) AS avg_load, ROUND(MIN(charge_remaining), 2) AS min_charge FROM \"{stream}\" WHERE cell_temp >= 22.0 GROUP BY half_min, facility_zone HAVING ROUND(AVG(load_factor), 2) > 30.0 ORDER BY half_min ASC, facility_zone ASC",
"category": "date_time",
"expected": {
"columns": [
"half_min",
"facility_zone",
"cnt",
"avg_load",
"min_charge"
],
"results": [
[
"2026-06-06T07:03:00",
"ZONE-3",
"1",
"33.0",
"33.3"
],
[
"2026-06-06T07:03:30",
"ZONE-1",
"1",
"72.8",
"10.0"
],
[
"2026-06-06T07:03:30",
"ZONE-2",
"1",
"88.1",
"25.0"
],
[
"2026-06-06T07:04:00",
"ZONE-1",
"1",
"94.6",
"42.5"
],
[
"2026-06-06T07:04:00",
"ZONE-3",
"1",
"94.6",
"42.5"
],
[
"2026-06-06T07:04:00",
"ZONE-4",
"1",
"88.1",
"25.0"
],
[
"2026-06-06T07:04:30",
"ZONE-2",
"1",
"45.3",
"58.0"
],
[
"2026-06-06T07:05:30",
"ZONE-3",
"1",
"99.0",
"95.0"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 4019000000,
"end_offset": 4183000000
}
},
{
"id": "Q069",
"sql": "WITH bucketed AS (SELECT histogram(_timestamp, '2 minutes') AS block, COUNT(*) AS cnt, ROUND(AVG(throughput_rate), 2) AS avg_tput FROM \"{stream}\" GROUP BY block) SELECT *, ROUND(AVG(avg_tput) OVER (ORDER BY block ROWS BETWEEN 2 PRECEDING AND CURRENT ROW), 2) AS smoothed_avg, ROW_NUMBER() OVER (ORDER BY cnt DESC) AS peak_rank FROM bucketed ORDER BY block ASC",
"category": "date_time",
"expected": {
"columns": [
"block",
"cnt",
"avg_tput",
"smoothed_avg",
"peak_rank"
],
"results": [
[
"2026-06-06T07:04:00",
"10",
"507.5",
"507.5",
"1"
],
[
"2026-06-06T07:06:00",
"4",
"673.75",
"590.63",
"2"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 4079000000,
"end_offset": 4243000000
}
},
{
"id": "Q070",
"sql": "SELECT histogram(_timestamp, '5 minutes') AS window_5m, sorter_model, COUNT(*) AS samples, ROUND(AVG(throughput_rate), 2) AS avg_tput, ROUND(AVG(cell_temp), 2) AS avg_temp, ROUND(CAST(SUM(CASE WHEN scan_attempts >= 3 THEN 1 ELSE 0 END) AS FLOAT) / NULLIF(COUNT(*), 0) * 100.0, 2) AS high_scan_pct FROM \"{stream}\" WHERE throughput_rate IS NOT NULL GROUP BY window_5m, sorter_model HAVING COUNT(*) >= 2 ORDER BY window_5m ASC, avg_tput DESC",
"category": "date_time",
"expected": {
"columns": [
"window_5m",
"sorter_model",
"samples",
"avg_tput",
"avg_temp",
"high_scan_pct"
],
"results": [
[
"2026-06-06T07:05:00",
"SORT-X1",
"3",
"668.33",
"30.3",
"66.66999816894531"
],
[
"2026-06-06T07:05:00",
"SORT-M3",
"4",
"653.75",
"27.83",
"75.0"
],
[
"2026-06-06T07:05:00",
"SORT-A7",
"4",
"421.25",
"25.53",
"25.0"
],
[
"2026-06-06T07:05:00",
"SORT-Z9",
"2",
"335.0",
"25.55",
"50.0"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 4139000000,
"end_offset": 4303000000
}
},
{
"id": "Q071",
"sql": "SELECT histogram(_timestamp) AS default_bucket, control_center, operation_mode, COUNT(*) AS event_count, ROUND(SUM(item_count), 0) AS total_items, ROUND(AVG(charge_remaining), 2) AS avg_charge FROM \"{stream}\" WHERE item_count >= 100 GROUP BY default_bucket, control_center, operation_mode ORDER BY default_bucket ASC, event_count DESC",
"category": "date_time",
"expected": {
"row_count": 19,
"columns": [
"default_bucket",
"control_center",
"operation_mode",
"event_count",
"total_items",
"avg_charge"
],
"note": "Default histogram + 3-field GROUP BY with item filter",
"skip_row_count": true,
"assertions": [
{
"type": "value_range",
"column": "event_count",
"min": 0
},
{
"type": "value_range",
"column": "total_items",
"min": 0
}
]
},
"time_offset": {
"start_offset": 4199000000,
"end_offset": 4363000000
}
},
{
"id": "Q072",
"sql": "SELECT bucket_a._time AS early_window, bucket_a.cnt AS early_cnt, bucket_a.avg_tput AS early_avg_tput, bucket_b._time AS late_window, bucket_b.cnt AS late_cnt, bucket_b.avg_tput AS late_avg_tput FROM (SELECT histogram(_timestamp, '3 minutes') AS _time, COUNT(*) AS cnt, ROUND(AVG(throughput_rate), 2) AS avg_tput FROM \"{stream}\" WHERE _timestamp < (SELECT MIN(_timestamp) + (MAX(_timestamp) - MIN(_timestamp)) / 2 FROM \"{stream}\") GROUP BY _time) bucket_a FULL OUTER JOIN (SELECT histogram(_timestamp, '3 minutes') AS _time, COUNT(*) AS cnt, ROUND(AVG(throughput_rate), 2) AS avg_tput FROM \"{stream}\" WHERE _timestamp >= (SELECT MIN(_timestamp) + (MAX(_timestamp) - MIN(_timestamp)) / 2 FROM \"{stream}\") GROUP BY _time) bucket_b ON bucket_a._time = bucket_b._time ORDER BY early_window ASC NULLS LAST",
"category": "date_time",
"expected": {
"columns": [
"early_window",
"early_cnt",
"early_avg_tput",
"late_window",
"late_cnt",
"late_avg_tput"
],
"results": [
[
"2026-06-06T07:06:00",
"7",
"350.71",
"2026-06-06T07:06:00",
"3",
"470.0"
],
[
"None",
"None",
"None",
"2026-06-06T07:09:00",
"4",
"725.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_column_check": true
},
"time_offset": {
"start_offset": 4259000000,
"end_offset": 4423000000
}
},
{
"id": "Q073",
"sql": "SELECT histogram(_timestamp, '1 minute') AS minute_slot, COUNT(*) AS total_events, ROUND(AVG(CASE WHEN cell_temp >= 28.0 THEN throughput_rate ELSE NULL END), 2) AS avg_tput_hot, ROUND(AVG(CASE WHEN cell_temp < 28.0 THEN throughput_rate ELSE NULL END), 2) AS avg_tput_cool FROM \"{stream}\" WHERE throughput_rate IS NOT NULL GROUP BY minute_slot ORDER BY minute_slot ASC",
"category": "date_time",
"expected": {
"columns": [
"minute_slot",
"total_events",
"avg_tput_hot",
"avg_tput_cool"
],
"results": [
[
"2026-06-06T07:08:00",
"5",
"380.0",
"373.33"
],
[
"2026-06-06T07:09:00",
"5",
"725.0",
"290.0"
],
[
"2026-06-06T07:10:00",
"4",
"None",
"397.5"
]
],
"results_mode": "rowsort"
},
"time_offset": {
"start_offset": 4319000000,
"end_offset": 4483000000
}
},
{
"id": "Q188",
"sql": "SELECT\n (_timestamp - (_timestamp % 60000000)) AS ts_minute,\n facility_zone,\n COUNT(*) AS cnt,\n AVG(throughput_rate) AS avg_throughput,\n MAX(cell_temp) AS max_temp,\n MIN(charge_remaining) AS min_charge,\n SUM(item_count) AS total_items\nFROM \"{stream}\"\nWHERE load_factor > 20.0\n AND throughput_rate >= 100.0\nGROUP BY (_timestamp - (_timestamp % 60000000)), facility_zone\nHAVING COUNT(*) >= 1\nORDER BY ts_minute DESC, cnt DESC\nLIMIT 20",
"category": "date_time",
"time_offset": {
"start_offset": 11219000000,
"end_offset": 11383000000
},
"expected": {
"columns": [
"ts_minute",
"facility_zone",
"cnt",
"avg_throughput",
"max_temp",
"min_charge",
"total_items"
],
"results": [
[
"1780736700000000",
"ZONE-1",
"1",
"320.0",
"19.2",
"75.3",
"410"
],
[
"1780736700000000",
"ZONE-2",
"1",
"480.0",
"24.8",
"88.7",
"275"
],
[
"1780736700000000",
"ZONE-3",
"1",
"610.0",
"28.9",
"95.0",
"60"
],
[
"1780736700000000",
"ZONE-4",
"1",
"480.0",
"24.8",
"88.7",
"275"
],
[
"1780736640000000",
"ZONE-3",
"2",
"610.0",
"30.1",
"42.5",
"498"
],
[
"1780736640000000",
"ZONE-1",
"1",
"900.0",
"30.1",
"42.5",
"88"
],
[
"1780736640000000",
"ZONE-4",
"1",
"190.0",
"26.3",
"25.0",
"340"
],
[
"1780736640000000",
"ZONE-2",
"1",
"150.0",
"35.7",
"58.0",
"155"
],
[
"1780736580000000",
"ZONE-2",
"2",
"240.0",
"26.3",
"25.0",
"460"
],
[
"1780736580000000",
"ZONE-1",
"1",
"555.0",
"22.0",
"10.0",
"200"
],
[
"1780736580000000",
"ZONE-3",
"1",
"840.0",
"40.0",
"33.3",
"50"
],
[
"1780736580000000",
"ZONE-4",
"1",
"290.0",
"18.5",
"66.6",
"120"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q189",
"sql": "SELECT time_band, facility_zone,\n COUNT(*) AS cnt,\n AVG(throughput_rate) AS avg_throughput\nFROM (\n SELECT _timestamp, facility_zone, throughput_rate, load_factor,\n CASE\n WHEN ((_timestamp - MIN(_timestamp) OVER ()) / 60000000) < 60 THEN 'first_minute'\n WHEN ((_timestamp - MIN(_timestamp) OVER ()) / 60000000) < 120 THEN 'second_minute'\n ELSE 'later'\n END AS time_band\n FROM \"{stream}\"\n WHERE load_factor > 10.0\n) sub\nGROUP BY time_band, facility_zone\nHAVING COUNT(*) >= 1\nORDER BY time_band, cnt DESC",
"category": "date_time",
"time_offset": {
"start_offset": 11279000000,
"end_offset": 11443000000
},
"expected": {
"columns": [
"time_band",
"facility_zone",
"cnt",
"avg_throughput"
],
"results": [
[
"first_minute",
"ZONE-3",
"4",
"667.5"
],
[
"first_minute",
"ZONE-4",
"4",
"421.25"
],
[
"first_minute",
"ZONE-1",
"3",
"686.6666666666666"
],
[
"first_minute",
"ZONE-2",
"3",
"451.6666666666667"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q296",
"sql": "SELECT _timestamp, _timestamp - 360000000 AS reduced_start, _timestamp + 60000000 AS reduced_end, visitor_session_id, action_category, exception_message FROM \"{stream}\" WHERE action_category = 'performanceMetric' AND exception_message LIKE '%Exception%' AND visitor_session_id IS NOT NULL",
"category": "date_time",
"time_offset": {
"start_offset": 17699000000,
"end_offset": 17773000000
},
"expected": {
"columns": [
"reduced_start",
"reduced_end",
"visitor_session_id",
"action_category",
"exception_message"
],
"results": [
[
"1780742700000000",
"1780743120000000",
"sess_001",
"performanceMetric",
"OverflowException: throughput_rate 999.0 exceeds max capacity"
],
[
"1780742736000000",
"1780743156000000",
"sess_003",
"performanceMetric",
"TimeoutException: lane LANE-A did not respond within 5000ms"
],
[
"1780742772000000",
"1780743192000000",
"sess_001",
"performanceMetric",
"ResourceExhaustedException: sorter_model SORT-M3 queue full"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q297",
"sql": "SELECT (_timestamp - (_timestamp % 60000000)) AS minute_bucket, COUNT(*) AS cnt FROM \"{stream}\" WHERE action_category = 'navigation' AND page_slug = 'itemPage' GROUP BY minute_bucket ORDER BY minute_bucket",
"category": "date_time",
"time_offset": {
"start_offset": 17759000000,
"end_offset": 17833000000
},
"expected": {
"columns": [
"minute_bucket",
"cnt"
],
"results": [
[
"1780743120000000",
"1"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q298",
"sql": "SELECT action_category, COUNT(*) AS cnt, MIN(_timestamp) AS first_event, MAX(_timestamp) AS last_event FROM \"{stream}\" WHERE action_category IN ('performanceMetric', 'navigation') GROUP BY action_category",
"category": "date_time",
"time_offset": {
"start_offset": 17819000000,
"end_offset": 17893000000
},
"expected": {
"columns": [
"action_category",
"cnt",
"first_event",
"last_event"
],
"results": [
[
"navigation",
"2",
"1780743234000000",
"1780743240000000"
],
[
"performanceMetric",
"4",
"1780743180000000",
"1780743252000000"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q299",
"sql": "SELECT _timestamp, concat(page_slug, '-', action_category) AS event_type, latency_ms, component_name FROM \"{stream}\" WHERE action_category = 'performanceMetric' AND latency_ms > 79 ORDER BY _timestamp DESC LIMIT 20",
"category": "date_time",
"time_offset": {
"start_offset": 17879000000,
"end_offset": 17953000000
},
"expected": {
"columns": [
"event_type",
"latency_ms",
"component_name"
],
"results": [
[
"itemPage-performanceMetric",
"1900",
"sorter-engine"
],
[
"itemPage-performanceMetric",
"1900",
"sorter-engine"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q300",
"sql": "SELECT (_timestamp - (_timestamp % 120000000)) AS two_min_bucket, (CASE WHEN os_platform LIKE '%Android%' THEN 'Android' WHEN os_platform LIKE '%iOS%' OR os_platform LIKE '%iPhone%' THEN 'iOS' ELSE 'Other' END) AS platform, COUNT(*) AS cnt FROM \"{stream}\" WHERE action_category = 'navigation' GROUP BY two_min_bucket, platform ORDER BY two_min_bucket",
"category": "date_time",
"time_offset": {
"start_offset": 17939000000,
"end_offset": 18013000000
},
"expected": {
"columns": [
"two_min_bucket",
"platform",
"cnt"
],
"results": [
[
"1780743240000000",
"Android",
"2"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q301",
"sql": "SELECT (_timestamp / 3600000000) * 3600000000 AS hour_bucket, COUNT(*) AS cnt, COUNT(DISTINCT visitor_session_id) AS users FROM \"{stream}\" WHERE action_category = 'performanceMetric' GROUP BY hour_bucket ORDER BY hour_bucket",
"category": "date_time",
"time_offset": {
"start_offset": 17999000000,
"end_offset": 18073000000
},
"expected": {
"columns": [
"hour_bucket",
"cnt",
"users"
],
"results": [
[
"1780743360000000.0",
"1",
"1"
],
[
"1780743372000000.0",
"1",
"1"
],
[
"1780743378000000.0",
"1",
"1"
],
[
"1780743396000000.0",
"1",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q302",
"sql": "SELECT _timestamp, visitor_session_id, action_category, page_slug, latency_ms FROM \"{stream}\" WHERE _timestamp BETWEEN (_timestamp - 300000000) AND (_timestamp + 300000000) AND action_category = 'performanceMetric' ORDER BY latency_ms DESC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 18059000000,
"end_offset": 18133000000
},
"expected": {
"columns": [
"visitor_session_id",
"action_category",
"page_slug",
"latency_ms"
],
"results": [
[
"sess_001",
"performanceMetric",
"itemPage",
"1900"
],
[
"sess_003",
"performanceMetric",
"itemPage",
"12"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q303",
"sql": "SELECT _timestamp, coalesce(page_url, page_slug) AS source, action_category, response_code, latency_ms FROM \"{stream}\" WHERE action_category = 'performanceMetric' AND latency_ms > 0 ORDER BY _timestamp DESC LIMIT 15",
"category": "date_time",
"time_offset": {
"start_offset": 18119000000,
"end_offset": 18193000000
},
"expected": {
"columns": [
"source",
"action_category",
"response_code",
"latency_ms"
],
"results": [
[
"https://shop.example.com/item/1003",
"performanceMetric",
"503",
"1450"
],
[
"https://shop.example.com/search?q=test",
"performanceMetric",
"500",
"230"
],
[
"searchPage",
"performanceMetric",
"500",
"230"
],
[
"https://shop.example.com/item/1001",
"performanceMetric",
"400",
"12"
],
[
"itemPage",
"performanceMetric",
"400",
"12"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q304",
"sql": "SELECT _timestamp, os_platform, action_category, page_slug, error_code FROM \"{stream}\" WHERE re_match(os_platform, 'Android|iPhone|iOS') AND page_slug IN ('itemPage', 'cartPage') AND action_category IN ('navigation', 'performanceMetric', 'interaction') ORDER BY _timestamp ASC LIMIT 25",
"category": "date_time",
"time_offset": {
"start_offset": 18179000000,
"end_offset": 18253000000
},
"expected": {
"columns": [
"os_platform",
"action_category",
"page_slug",
"error_code"
],
"results": [
[
"Android 12",
"performanceMetric",
"cartPage",
"E004"
],
[
"Android 12",
"performanceMetric",
"cartPage",
"E004"
],
[
"Mac OS X (iPhone)",
"performanceMetric",
"itemPage",
"E005"
],
[
"Android 14",
"interaction",
"itemPage",
"E007"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q305",
"sql": "SELECT (_timestamp / 3600000000) * 3600000000 AS hour_slot, page_slug, COUNT(*) AS cnt FROM \"{stream}\" WHERE action_category = 'navigation' GROUP BY hour_slot, page_slug ORDER BY hour_slot, cnt DESC",
"category": "date_time",
"time_offset": {
"start_offset": 18239000000,
"end_offset": 18313000000
},
"expected": {
"columns": [
"hour_slot",
"page_slug",
"cnt"
],
"results": [
[
"1780743636000000.0",
"homePage",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q453",
"sql": "SELECT (_timestamp / 3600000000) * 3600000000 AS hour_bucket, action_category, COUNT(*) AS cnt FROM \"{stream}\" WHERE action_category IS NOT NULL GROUP BY hour_bucket, action_category ORDER BY hour_bucket ASC, cnt DESC",
"category": "date_time",
"time_offset": {
"start_offset": 27119000000,
"end_offset": 27193000000
},
"expected": {
"columns": [
"hour_bucket",
"action_category",
"cnt"
],
"results": [
[
"1780752480000000.0",
"interaction",
"1"
],
[
"1780752492000000.0",
"performanceMetric",
"1"
],
[
"1780752498000000.0",
"performanceMetric",
"1"
],
[
"1780752516000000.0",
"navigation",
"1"
],
[
"1780752534000000.0",
"performanceMetric",
"1"
],
[
"1780752540000000.0",
"performanceMetric",
"1"
],
[
"1780752552000000.0",
"performanceMetric",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q454",
"sql": "SELECT (_timestamp / 60000000) * 60000000 AS minute_bucket, COUNT(*) AS cnt, COUNT(DISTINCT visitor_session_id) AS users FROM \"{stream}\" WHERE action_category = 'performanceMetric' GROUP BY minute_bucket ORDER BY minute_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 27179000000,
"end_offset": 27253000000
},
"expected": {
"columns": [
"minute_bucket",
"cnt",
"users"
],
"results": [
[
"1780752540000000.0",
"1",
"1"
],
[
"1780752552000000.0",
"1",
"1"
],
[
"1780752558000000.0",
"1",
"1"
],
[
"1780752576000000.0",
"1",
"1"
],
[
"1780752594000000.0",
"1",
"1"
],
[
"1780752600000000.0",
"1",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q455",
"sql": "SELECT _timestamp, action_category, page_slug FROM \"{stream}\" WHERE action_category = 'performanceMetric' ORDER BY _timestamp ASC LIMIT 10 OFFSET 2",
"category": "date_time",
"time_offset": {
"start_offset": 27239000000,
"end_offset": 27313000000
},
"expected": {
"columns": [
"action_category",
"page_slug"
],
"results": [
[
"performanceMetric",
"itemPage"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q456",
"sql": "SELECT (CASE WHEN _timestamp % 60000000 < 30000000 THEN 'first_half' ELSE 'second_half' END) AS half_of_minute, COUNT(*) AS cnt FROM \"{stream}\" WHERE action_category = 'performanceMetric' GROUP BY half_of_minute ORDER BY half_of_minute ASC",
"category": "date_time",
"time_offset": {
"start_offset": 27299000000,
"end_offset": 27373000000
},
"expected": {
"columns": [
"half_of_minute",
"cnt"
],
"results": [
[
"first_half",
"2"
],
[
"second_half",
"1"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q457",
"sql": "SELECT _timestamp, (LEAD(_timestamp) OVER (ORDER BY _timestamp) - _timestamp) / 1000 AS gap_ms FROM \"{stream}\" WHERE action_category = 'navigation' ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 27359000000,
"end_offset": 27433000000
},
"expected": {
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true,
"columns": [
"gap_ms"
]
}
},
{
"id": "Q458",
"sql": "SELECT page_slug, MIN(_timestamp) AS first_seen, MAX(_timestamp) AS last_seen, (MAX(_timestamp) - MIN(_timestamp)) / 1000000 AS duration_seconds FROM \"{stream}\" WHERE action_category = 'performanceMetric' AND page_slug IS NOT NULL GROUP BY page_slug ORDER BY duration_seconds DESC, page_slug ASC",
"category": "date_time",
"time_offset": {
"start_offset": 27419000000,
"end_offset": 27493000000
},
"expected": {
"columns": [
"page_slug",
"first_seen",
"last_seen",
"duration_seconds"
],
"results": [
[
"itemPage",
"1780752780000000",
"1780752852000000",
"72.0"
],
[
"checkoutPage",
"1780752792000000",
"1780752798000000",
"6.0"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q459",
"sql": "SELECT _timestamp, page_slug, (ROW_NUMBER() OVER (PARTITION BY page_slug ORDER BY _timestamp) - 1) * 18000 AS ms_since_first FROM \"{stream}\" WHERE action_category = 'performanceMetric' AND page_slug IS NOT NULL ORDER BY page_slug ASC, _timestamp ASC LIMIT 15",
"category": "date_time",
"time_offset": {
"start_offset": 27479000000,
"end_offset": 27553000000
},
"expected": {
"columns": [
"page_slug",
"ms_since_first"
],
"results": [
[
"itemPage",
"0"
],
[
"itemPage",
"18000"
],
[
"itemPage",
"36000"
],
[
"itemPage",
"54000"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q460",
"sql": "SELECT _timestamp, action_category, page_slug, visitor_session_id FROM \"{stream}\" WHERE action_category = 'navigation' ORDER BY _timestamp ASC LIMIT 5 OFFSET 0",
"category": "date_time",
"time_offset": {
"start_offset": 27539000000,
"end_offset": 27613000000
},
"expected": {
"columns": [
"action_category",
"page_slug",
"visitor_session_id"
],
"results": [
[
"navigation",
"itemPage",
"sess_005"
],
[
"navigation",
"itemPage",
"sess_005"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q521",
"sql": "SELECT _timestamp, _timestamp - arrow_cast(360000000, 'Int64') AS earlier_ts, _timestamp + arrow_cast(60000000, 'Int64') AS later_ts, latency_ms FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 31199000000,
"end_offset": 31273000000
},
"expected": {
"row_count": 7,
"columns": [
"_timestamp",
"earlier_ts",
"later_ts",
"latency_ms"
],
"note": "arrow_cast() is OO-specific (DataFusion); DuckDB cannot replicate",
"skip_sqllogictest": true
}
},
{
"id": "Q522",
"sql": "SELECT (_timestamp / 60000000) * 60000000 AS minute_bucket, COUNT(*) AS cnt, MAX(latency_ms) AS max_latency FROM \"{stream}\" GROUP BY minute_bucket ORDER BY minute_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 31259000000,
"end_offset": 31333000000
},
"expected": {
"columns": [
"minute_bucket",
"cnt",
"max_latency"
],
"results": [
[
"1780756620000000.0",
"1",
"3200"
],
[
"1780756632000000.0",
"1",
"78"
],
[
"1780756638000000.0",
"1",
"78"
],
[
"1780756656000000.0",
"1",
"1900"
],
[
"1780756674000000.0",
"1",
"15"
],
[
"1780756680000000.0",
"1",
"15"
],
[
"1780756692000000.0",
"1",
"12"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true
}
},
{
"id": "Q523",
"sql": "SELECT _timestamp, to_timestamp_micros(_timestamp + latency_ms * 1000) AS adjusted_ts, latency_ms FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 5",
"category": "date_time",
"time_offset": {
"start_offset": 31319000000,
"end_offset": 31393000000
},
"expected": {
"row_count": 5,
"columns": [
"_timestamp",
"adjusted_ts",
"latency_ms"
],
"note": "to_timestamp_micros() is OO-specific (DataFusion); DuckDB cannot replicate",
"skip_sqllogictest": true
}
},
{
"id": "Q524",
"sql": "SELECT (_timestamp / 30000000) * 30000000 AS thirty_sec_bucket, COUNT(*) AS cnt, MIN(latency_ms) AS min_lat, MAX(latency_ms) AS max_lat FROM \"{stream}\" GROUP BY thirty_sec_bucket ORDER BY thirty_sec_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 31379000000,
"end_offset": 31453000000
},
"expected": {
"columns": [
"thirty_sec_bucket",
"cnt",
"min_lat",
"max_lat"
],
"results": [
[
"1780756740000000.0",
"1",
"230",
"230"
],
[
"1780756752000000.0",
"1",
"1450",
"1450"
],
[
"1780756758000000.0",
"1",
"1450",
"1450"
],
[
"1780756776000000.0",
"1",
"89",
"89"
],
[
"1780756794000000.0",
"1",
"567",
"567"
],
[
"1780756800000000.0",
"1",
"567",
"567"
],
[
"1780756812000000.0",
"1",
"3200",
"3200"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true
}
},
{
"id": "Q525",
"sql": "SELECT _timestamp, _timestamp - (_timestamp % 60000000) AS rounded_minute, latency_ms, throughput_rate FROM \"{stream}\" WHERE latency_ms > 100 ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 31439000000,
"end_offset": 31513000000
},
"expected": {
"columns": [
"rounded_minute",
"latency_ms",
"throughput_rate"
],
"results": [
[
"1780756800000000",
"567",
"290.0"
],
[
"1780756800000000",
"3200",
"555.0"
],
[
"1780756800000000",
"3200",
"555.0"
],
[
"1780756800000000",
"1900",
"900.0"
],
[
"1780756860000000",
"1900",
"900.0"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q526",
"sql": "SELECT _timestamp, CAST((_timestamp - LAG(_timestamp) OVER (ORDER BY _timestamp)) AS BIGINT) / 1000 AS gap_ms, latency_ms FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 5",
"category": "date_time",
"time_offset": {
"start_offset": 31499000000,
"end_offset": 31573000000
},
"expected": {
"columns": [
"gap_ms",
"latency_ms"
],
"results": [
[
"None",
"1900"
],
[
"12000.0",
"15"
],
[
"6000.0",
"15"
],
[
"18000.0",
"12"
],
[
"18000.0",
"45"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q878",
"sql": "SELECT _timestamp, (_timestamp / 60000000) * 60000000 AS minute_trunc, (_timestamp / 30000000) * 30000000 AS thirty_sec_bucket, latency_ms FROM \"{stream}\" WHERE latency_ms IS NOT NULL ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 52619000000,
"end_offset": 52693000000
},
"expected": {
"columns": [
"minute_trunc",
"thirty_sec_bucket",
"latency_ms"
],
"results": [
[
"1780777980000000.0",
"1780777980000000.0",
"89"
],
[
"1780777992000000.0",
"1780777992000000.0",
"567"
],
[
"1780777998000000.0",
"1780777998000000.0",
"567"
],
[
"1780778016000000.0",
"1780778016000000.0",
"3200"
],
[
"1780778034000000.0",
"1780778034000000.0",
"78"
],
[
"1780778040000000.0",
"1780778040000000.0",
"78"
],
[
"1780778052000000.0",
"1780778052000000.0",
"1900"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q879",
"sql": "SELECT (_timestamp / 60000000) * 60000000 AS minute_bucket, COUNT(*) AS cnt, AVG(latency_ms) AS avg_lat, MAX(latency_ms) AS max_lat FROM \"{stream}\" WHERE latency_ms IS NOT NULL GROUP BY minute_bucket ORDER BY minute_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 52679000000,
"end_offset": 52753000000
},
"expected": {
"columns": [
"minute_bucket",
"cnt",
"avg_lat",
"max_lat"
],
"results": [
[
"1780778040000000.0",
"1",
"78.0",
"78"
],
[
"1780778052000000.0",
"1",
"1900.0",
"1900"
],
[
"1780778058000000.0",
"1",
"1900.0",
"1900"
],
[
"1780778076000000.0",
"1",
"15.0",
"15"
],
[
"1780778094000000.0",
"1",
"12.0",
"12"
],
[
"1780778100000000.0",
"1",
"12.0",
"12"
],
[
"1780778112000000.0",
"1",
"45.0",
"45"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q880",
"sql": "SELECT _timestamp, to_timestamp_micros(_timestamp) AS ts_converted, latency_ms FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 52739000000,
"end_offset": 52813000000
},
"expected": {
"skip_sqllogictest": true
}
},
{
"id": "Q881",
"sql": "SELECT _timestamp, _timestamp + arrow_cast(3600000000, 'Int64') AS future_ts, _timestamp - arrow_cast(3600000000, 'Int64') AS past_ts FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 52799000000,
"end_offset": 52873000000
},
"expected": {
"skip_sqllogictest": true
}
},
{
"id": "Q882",
"sql": "SELECT _timestamp, (_timestamp - LAG(_timestamp) OVER (ORDER BY _timestamp)) / 1000 AS gap_ms FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 52859000000,
"end_offset": 52933000000
},
"expected": {
"columns": [
"gap_ms"
],
"results": [
[
"None"
],
[
"12000.0"
],
[
"6000.0"
],
[
"18000.0"
],
[
"18000.0"
],
[
"6000.0"
],
[
"12000.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q883",
"sql": "SELECT _timestamp, (_timestamp / 3600000000) * 3600000000 AS hour_bucket, COUNT(*) OVER (PARTITION BY (_timestamp / 3600000000) * 3600000000) AS cnt_in_hour, throughput_rate FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 52919000000,
"end_offset": 52993000000
},
"expected": {
"columns": [
"hour_bucket",
"cnt_in_hour",
"throughput_rate"
],
"results": [
[
"1780778280000000.0",
"1",
"150.0"
],
[
"1780778292000000.0",
"1",
"320.0"
],
[
"1780778298000000.0",
"1",
"320.0"
],
[
"1780778316000000.0",
"1",
"480.0"
],
[
"1780778334000000.0",
"1",
"610.0"
],
[
"1780778340000000.0",
"1",
"610.0"
],
[
"1780778352000000.0",
"1",
"725.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q884",
"sql": "SELECT (_timestamp / 60000000) * 60000000 AS minute_bucket, component_name, COUNT(*) AS cnt, AVG(CAST(latency_ms AS FLOAT)) AS avg_lat FROM \"{stream}\" WHERE latency_ms IS NOT NULL GROUP BY minute_bucket, component_name ORDER BY minute_bucket ASC, cnt DESC LIMIT 15",
"category": "date_time",
"time_offset": {
"start_offset": 52979000000,
"end_offset": 53053000000
},
"expected": {
"columns": [
"minute_bucket",
"component_name",
"cnt",
"avg_lat"
],
"results": [
[
"1780778340000000.0",
"track-router",
"1",
"230.0"
],
[
"1780778352000000.0",
"batch-sync",
"1",
"1450.0"
],
[
"1780778358000000.0",
"batch-sync",
"1",
"1450.0"
],
[
"1780778376000000.0",
"pallet-mapper",
"1",
"89.0"
],
[
"1780778394000000.0",
"lane-monitor",
"1",
"567.0"
],
[
"1780778400000000.0",
"lane-monitor",
"1",
"567.0"
],
[
"1780778412000000.0",
"temp-regulator",
"1",
"3200.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q885",
"sql": "SELECT _timestamp, _timestamp - (_timestamp % 30000000) AS aligned_30s, lead(_timestamp, 1) OVER (ORDER BY _timestamp) - _timestamp AS lead_gap FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53039000000,
"end_offset": 53113000000
},
"expected": {
"columns": [
"aligned_30s",
"lead_gap"
],
"results": [
[
"1780778400000000",
"12000000"
],
[
"1780778400000000",
"6000000"
],
[
"1780778400000000",
"18000000"
],
[
"1780778430000000",
"18000000"
],
[
"1780778430000000",
"6000000"
],
[
"1780778460000000",
"12000000"
],
[
"1780778460000000",
"None"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q886",
"sql": "SELECT EXTRACT(HOUR FROM to_timestamp_micros(_timestamp)) AS hour_of_day, COUNT(*) AS cnt FROM \"{stream}\" GROUP BY hour_of_day ORDER BY hour_of_day",
"category": "date_time",
"time_offset": {
"start_offset": 53099000000,
"end_offset": 53173000000
},
"expected": {
"skip_sqllogictest": true
}
},
{
"id": "Q887",
"sql": "SELECT _timestamp, _timestamp / 1000000 AS epoch_seconds, (_timestamp / 1000000) % 60 AS second_of_minute FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53159000000,
"end_offset": 53233000000
},
"expected": {
"columns": [
"epoch_seconds",
"second_of_minute"
],
"results": [
[
"1780778520.0",
"0.0"
],
[
"1780778532.0",
"12.0"
],
[
"1780778538.0",
"18.0"
],
[
"1780778556.0",
"36.0"
],
[
"1780778574.0",
"54.0"
],
[
"1780778580.0",
"0.0"
],
[
"1780778592.0",
"12.0"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q888",
"sql": "SELECT (_timestamp / 3600000000) * 3600000000 AS hour_bucket, COUNT(*) AS cnt, SUM(throughput_rate) AS total_rate FROM \"{stream}\" GROUP BY hour_bucket ORDER BY hour_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 53219000000,
"end_offset": 53293000000
},
"expected": {
"columns": [
"hour_bucket",
"cnt",
"total_rate"
],
"results": [
[
"1780778580000000.0",
"1",
"840.0"
],
[
"1780778592000000.0",
"1",
"290.0"
],
[
"1780778598000000.0",
"1",
"290.0"
],
[
"1780778616000000.0",
"1",
"555.0"
],
[
"1780778634000000.0",
"1",
"190.0"
],
[
"1780778640000000.0",
"1",
"190.0"
],
[
"1780778652000000.0",
"1",
"900.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q889",
"sql": "SELECT _timestamp, (_timestamp / 1000000) * 1000000 AS second_trunc, latency_ms, throughput_rate FROM \"{stream}\" WHERE throughput_rate > 200 ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53279000000,
"end_offset": 53353000000
},
"expected": {
"columns": [
"second_trunc",
"latency_ms",
"throughput_rate"
],
"results": [
[
"1780778652000000.0",
"1900",
"900.0"
],
[
"1780778658000000.0",
"1900",
"900.0"
],
[
"1780778694000000.0",
"12",
"320.0"
],
[
"1780778700000000.0",
"12",
"320.0"
],
[
"1780778712000000.0",
"45",
"480.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q890",
"sql": "SELECT (_timestamp / 15000000) * 15000000 AS fifteen_sec_bucket, facility_zone, COUNT(*) AS cnt FROM \"{stream}\" GROUP BY fifteen_sec_bucket, facility_zone ORDER BY fifteen_sec_bucket ASC LIMIT 15",
"category": "date_time",
"time_offset": {
"start_offset": 53339000000,
"end_offset": 53413000000
},
"expected": {
"columns": [
"fifteen_sec_bucket",
"facility_zone",
"cnt"
],
"results": [
[
"1780778700000000.0",
"ZONE-1",
"1"
],
[
"1780778712000000.0",
"ZONE-4",
"1"
],
[
"1780778718000000.0",
"ZONE-2",
"1"
],
[
"1780778736000000.0",
"ZONE-3",
"1"
],
[
"1780778754000000.0",
"ZONE-4",
"1"
],
[
"1780778760000000.0",
"ZONE-2",
"1"
],
[
"1780778772000000.0",
"ZONE-1",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q891",
"sql": "SELECT _timestamp, to_timestamp_micros(_timestamp) AS ts_dt, arrow_cast(to_timestamp_micros(_timestamp), 'Timestamp(Nanosecond, None)') AS ts_ns FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53399000000,
"end_offset": 53473000000
},
"expected": {
"skip_sqllogictest": true
}
},
{
"id": "Q892",
"sql": "SELECT _timestamp, _timestamp - MIN(_timestamp) OVER () AS offset_from_start, throughput_rate FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53459000000,
"end_offset": 53533000000
},
"expected": {
"columns": [
"offset_from_start",
"throughput_rate"
],
"results": [
[
"0",
"555.0"
],
[
"12000000",
"190.0"
],
[
"18000000",
"190.0"
],
[
"36000000",
"900.0"
],
[
"54000000",
"150.0"
],
[
"60000000",
"150.0"
],
[
"72000000",
"320.0"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q893",
"sql": "SELECT _timestamp, (_timestamp / 60000000) * 60000000 AS minute_bucket, MAX(throughput_rate) OVER (PARTITION BY (_timestamp / 60000000) * 60000000) AS peak_in_minute FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53519000000,
"end_offset": 53593000000
},
"expected": {
"columns": [
"minute_bucket",
"peak_in_minute"
],
"results": [
[
"1780778880000000.0",
"150.0"
],
[
"1780778892000000.0",
"320.0"
],
[
"1780778898000000.0",
"320.0"
],
[
"1780778916000000.0",
"480.0"
],
[
"1780778934000000.0",
"610.0"
],
[
"1780778940000000.0",
"610.0"
],
[
"1780778952000000.0",
"725.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q894",
"sql": "SELECT (_timestamp / 60000000) * 60000000 AS minute_bucket, COALESCE(operation_mode, 'unknown') AS mode, COUNT(*) AS cnt, AVG(throughput_rate) AS avg_rate FROM \"{stream}\" GROUP BY minute_bucket, mode ORDER BY minute_bucket ASC, cnt DESC LIMIT 15",
"category": "date_time",
"time_offset": {
"start_offset": 53579000000,
"end_offset": 53653000000
},
"expected": {
"columns": [
"minute_bucket",
"mode",
"cnt",
"avg_rate"
],
"results": [
[
"1780778940000000.0",
"auto",
"1",
"610.0"
],
[
"1780778952000000.0",
"hybrid",
"1",
"725.0"
],
[
"1780778958000000.0",
"manual",
"1",
"725.0"
],
[
"1780778976000000.0",
"hybrid",
"1",
"840.0"
],
[
"1780778994000000.0",
"auto",
"1",
"290.0"
],
[
"1780779000000000.0",
"auto",
"1",
"290.0"
],
[
"1780779012000000.0",
"manual",
"1",
"555.0"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q895",
"sql": "SELECT _timestamp, _timestamp + (latency_ms * 1000) AS response_ts, latency_ms FROM \"{stream}\" WHERE latency_ms IS NOT NULL ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53639000000,
"end_offset": 53713000000
},
"expected": {
"columns": [
"response_ts",
"latency_ms"
],
"results": [
[
"1780779000567000",
"567"
],
[
"1780779015200000",
"3200"
],
[
"1780779021200000",
"3200"
],
[
"1780779036078000",
"78"
],
[
"1780779055900000",
"1900"
],
[
"1780779061900000",
"1900"
],
[
"1780779072015000",
"15"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q896",
"sql": "SELECT (_timestamp / 120000000) * 120000000 AS two_min_bucket, COUNT(*) AS cnt, MAX(latency_ms) AS max_lat, MIN(latency_ms) AS min_lat FROM \"{stream}\" WHERE latency_ms IS NOT NULL GROUP BY two_min_bucket ORDER BY two_min_bucket ASC",
"category": "date_time",
"time_offset": {
"start_offset": 53699000000,
"end_offset": 53773000000
},
"expected": {
"columns": [
"two_min_bucket",
"cnt",
"max_lat",
"min_lat"
],
"results": [
[
"1780779060000000.0",
"1",
"1900",
"1900"
],
[
"1780779072000000.0",
"1",
"15",
"15"
],
[
"1780779078000000.0",
"1",
"15",
"15"
],
[
"1780779096000000.0",
"1",
"12",
"12"
],
[
"1780779114000000.0",
"1",
"45",
"45"
],
[
"1780779120000000.0",
"1",
"45",
"45"
],
[
"1780779132000000.0",
"1",
"230",
"230"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
},
{
"id": "Q897",
"sql": "SELECT _timestamp, _timestamp / 1000000 AS epoch_seconds, (_timestamp / 1000000) / 60 AS epoch_minutes FROM \"{stream}\" ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53759000000,
"end_offset": 53833000000
},
"expected": {
"columns": [
"epoch_seconds",
"epoch_minutes"
],
"results": [
[
"1780779120.0",
"29679652.0"
],
[
"1780779132.0",
"29679652.2"
],
[
"1780779138.0",
"29679652.3"
],
[
"1780779156.0",
"29679652.6"
],
[
"1780779174.0",
"29679652.9"
],
[
"1780779180.0",
"29679653.0"
],
[
"1780779192.0",
"29679653.2"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q898",
"sql": "SELECT (_timestamp / 1000000) * 1000000 AS second_bucket, COUNT(*) AS cnt FROM \"{stream}\" GROUP BY second_bucket ORDER BY cnt DESC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53819000000,
"end_offset": 53893000000
},
"expected": {
"columns": [
"second_bucket",
"cnt"
],
"results": [
[
"1780779216000000.0",
"1"
],
[
"1780779234000000.0",
"1"
],
[
"1780779252000000.0",
"1"
],
[
"1780779240000000.0",
"1"
],
[
"1780779180000000.0",
"1"
],
[
"1780779192000000.0",
"1"
],
[
"1780779198000000.0",
"1"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true
}
},
{
"id": "Q899",
"sql": "WITH time_data AS (SELECT _timestamp, _timestamp - MIN(_timestamp) OVER () AS rel_time, throughput_rate FROM \"{stream}\") SELECT _timestamp, rel_time / 1000 AS rel_ms, throughput_rate FROM time_data ORDER BY _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53879000000,
"end_offset": 53953000000
},
"expected": {
"columns": [
"rel_ms",
"throughput_rate"
],
"results": [
[
"0.0",
"190.0"
],
[
"12000.0",
"900.0"
],
[
"18000.0",
"900.0"
],
[
"36000.0",
"150.0"
],
[
"54000.0",
"320.0"
],
[
"60000.0",
"320.0"
],
[
"72000.0",
"480.0"
]
],
"results_mode": "rowsort"
}
},
{
"id": "Q900",
"sql": "SELECT _timestamp, _timestamp - LAG(_timestamp) OVER (PARTITION BY component_name ORDER BY _timestamp) AS comp_gap, component_name, latency_ms FROM \"{stream}\" WHERE latency_ms IS NOT NULL ORDER BY component_name, _timestamp ASC LIMIT 10",
"category": "date_time",
"time_offset": {
"start_offset": 53939000000,
"end_offset": 54013000000
},
"expected": {
"columns": [
"comp_gap",
"component_name",
"latency_ms"
],
"results": [
[
"None",
"batch-sync",
"1450"
],
[
"6000000",
"batch-sync",
"1450"
],
[
"None",
"pallet-mapper",
"89"
],
[
"None",
"scan-hub",
"45"
],
[
"6000000",
"scan-hub",
"45"
],
[
"None",
"track-router",
"230"
],
[
"None",
"zone-controller",
"12"
]
],
"results_mode": "rowsort",
"skip_sqllogictest": true,
"skip_row_count": true,
"skip_column_check": true
}
}
],
"last_query_id": 73
}