mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-03 20:02:54 +00:00
* tests: flow sqlness tests * tests: WIP df func test * fix: use schema before expand for transform expr * tests: some basic flow tests * tests: unit test * chore: dep use rev not patch * fix: wired sqlness error? * refactor: per review * fix: temp sqlness bug * fix: use fixed sqlness * fix: impl drop as async shutdown * refactor: per bot's review * tests: drop worker handler both sync/async * docs: add rationale for test * refactor: per review * chore: fmt
32 lines
728 B
SQL
32 lines
728 B
SQL
CREATE TABLE numbers_input (
|
|
number INT,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(number),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
CREATE FLOW test_numbers
|
|
SINK TO out_num_cnt
|
|
AS
|
|
SELECT sum(number) FROM numbers_input GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00');
|
|
|
|
INSERT INTO numbers_input
|
|
VALUES
|
|
(20, "2021-07-01 00:00:00.200"),
|
|
(22, "2021-07-01 00:00:00.600");
|
|
|
|
-- SQLNESS SLEEP 3s
|
|
SELECT col_0, window_start, window_end FROM out_num_cnt;
|
|
|
|
INSERT INTO numbers_input
|
|
VALUES
|
|
(23,"2021-07-01 00:00:01.000"),
|
|
(24,"2021-07-01 00:00:01.500");
|
|
|
|
-- SQLNESS SLEEP 2s
|
|
SELECT col_0, window_start, window_end FROM out_num_cnt;
|
|
|
|
DROP FLOW test_numbers;
|
|
DROP TABLE numbers_input;
|
|
DROP TABLE out_num_cnt;
|