-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cc5119
commit 33328d0
Showing
5 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/queries_ported/0_stateless/99010_time_weighted_avg.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
0 | ||
3.5 | ||
3.8 | ||
3.8 | ||
3.5 |
18 changes: 18 additions & 0 deletions
18
tests/queries_ported/0_stateless/99010_time_weighted_avg.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
DROP STREAM IF EXISTS test_99010; | ||
|
||
CREATE STREAM test_99010 (val int, a DateTime, b Date, c Date32, d DateTime64); | ||
|
||
INSERT INTO test_99010(val, a, b, c, d) VALUES (1, to_datetime('2024-11-29 12:12:13'), '2024-11-29', '2024-11-29', to_datetime64('2024-11-29 12:12:13.123', 3)); | ||
INSERT INTO test_99010(val, a, b, c, d) VALUES (2, to_datetime('2024-11-29 12:12:16'), '2024-11-30', '2024-11-30', to_datetime64('2024-11-29 12:12:13.126', 3)); | ||
INSERT INTO test_99010(val, a, b, c, d) VALUES (3, to_datetime('2024-11-29 12:12:17'), '2024-12-01', '2024-12-01', to_datetime64('2024-11-29 12:12:13.127', 3)); | ||
INSERT INTO test_99010(val, a, b, c, d) VALUES (4, to_datetime('2024-11-29 12:12:18'), '2024-12-03', '2024-12-03', to_datetime64('2024-11-29 12:12:13.128', 3)); | ||
INSERT INTO test_99010(val, a, b, c, d) VALUES (5, to_datetime('2024-11-29 12:12:19'), '2024-12-28', '2024-12-28', to_datetime64('2024-11-29 12:12:13.129', 3)); | ||
INSERT INTO test_99010(val, a, b, c, d) VALUES (6, to_datetime('2024-11-29 12:12:25'), '2024-12-29', '2024-12-29', to_datetime64('2024-11-29 12:12:13.135', 3)); | ||
SELECT sleep(3); | ||
|
||
SELECT time_weighted_avg(val, a) FROM (SELECT * FROM table(test_99010) ORDER BY a); | ||
SELECT time_weighted_avg(val, b) FROM (SELECT * FROM table(test_99010) ORDER BY b); | ||
SELECT time_weighted_avg(val, c) FROM (SELECT * FROM table(test_99010) ORDER BY c); | ||
SELECT time_weighted_avg(val, d) FROM (SELECT * FROM table(test_99010) ORDER BY d); | ||
DROP STREAM IF EXISTS test_99010; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"test_suite_name": "streaming_func", | ||
"tag": "smoke", | ||
"test_suite_config":{ | ||
"setup": { | ||
"statements": [ | ||
] | ||
}, | ||
"tests_2_run": {"ids_2_run": ["all"], "tags_2_run":[], "tags_2_skip":{"default":["todo", "to_support", "change", "bug", "sample"],"cluster": ["view", "cluster_table_bug"]}} | ||
}, | ||
"comments": "Tests covering query state checkpointing smoke test cases", | ||
"tests": [ | ||
{ | ||
"id": 1, | ||
"tags": ["query_state"], | ||
"name": "global_aggr_with_fun_time_weighted_avg", | ||
"description": "global aggregation with function time_weighted_avg state checkpoint", | ||
"steps":[ | ||
{ | ||
"statements": [ | ||
{"client":"python", "query_type": "table", "query":"drop stream if exists test35_state_stream1"}, | ||
{"client":"python", "query_type": "table", "exist":"test35_state_stream1", "exist_wait":2, "wait":1, "query":"create stream test35_state_stream1 (val int32, timestamp datetime64(3) default now64(3))"}, | ||
{"client":"python", "query_type": "stream", "query_id":"3600", "depends_on_stream":"test35_state_stream1", "wait":1, "terminate":"manual", "query":"subscribe to select time_weighted_avg(val, timestamp) from test35_state_stream1 emit periodic 1s settings checkpoint_interval=1"}, | ||
{"client":"python", "query_type": "table", "depends_on":"3600", "kill":"3600", "kill_wait":5, "wait":3, "query": "insert into test35_state_stream1(val, timestamp) values (1, '2020-02-02 20:00:00'), (2, '2020-02-02 20:00:01'), (3, '2020-02-02 20:00:03'), (3, '2020-02-02 20:00:04'), (3, '2020-02-02 20:00:05')"}, | ||
{"client":"python", "query_type": "table", "wait":1, "query":"unsubscribe to '3600'"} | ||
] | ||
} | ||
], | ||
"expected_results": [ | ||
{ | ||
"query_id":"3600", | ||
"expected_results":[ | ||
["2.2"] | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |