mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-28 02:40:38 +00:00
feat: flow perf&fix df func call (#4347)
* feat: flow perf&fix df func call feat: make source sender `send` non-blocking feat: better control of flow worker freq feat: support transform interval fix: const folding df func args&tests tests: update cast const fold chore: adjust flow work's freq refactor: batch split feat: adaptive run freq flow worker&check for errors chore: better debug log * refactor: per review * chore: per zc's review * chore: per bot review * chore: remove some `TODO` completed * docs: add comments for a test
This commit is contained in:
@@ -30,34 +30,24 @@ DROP FLOW test_numbers;
|
||||
DROP TABLE numbers_input;
|
||||
DROP TABLE out_num_cnt;
|
||||
|
||||
-- test interprete interval
|
||||
|
||||
CREATE TABLE numbers_input (
|
||||
number INT,
|
||||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY(number),
|
||||
TIME INDEX(ts)
|
||||
);
|
||||
create table out_num_cnt (
|
||||
number INT,
|
||||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP TIME INDEX);
|
||||
|
||||
CREATE FLOW test_numbers
|
||||
SINK TO out_num_cnt
|
||||
AS
|
||||
SELECT date_trunc('second', ts), sum(number) FROM numbers_input GROUP BY date_trunc('second', ts);
|
||||
CREATE FLOW filter_numbers SINK TO out_num_cnt AS SELECT INTERVAL '1 day 1 second', INTERVAL '1 month 1 day 1 second', INTERVAL '1 year 1 month' FROM numbers_input where number > 10;
|
||||
|
||||
INSERT INTO numbers_input
|
||||
VALUES
|
||||
(20, "2021-07-01 00:00:00.200"),
|
||||
(22, "2021-07-01 00:00:00.600");
|
||||
SHOW CREATE FLOW filter_numbers;
|
||||
|
||||
-- SQLNESS SLEEP 3s
|
||||
SELECT col_0, col_1 FROM out_num_cnt;
|
||||
drop flow filter_numbers;
|
||||
|
||||
INSERT INTO numbers_input
|
||||
VALUES
|
||||
(23,"2021-07-01 00:00:01.000"),
|
||||
(24,"2021-07-01 00:00:01.500");
|
||||
drop table out_num_cnt;
|
||||
|
||||
-- SQLNESS SLEEP 2s
|
||||
SELECT col_0, col_1 FROM out_num_cnt;
|
||||
|
||||
DROP FLOW test_numbers;
|
||||
DROP TABLE numbers_input;
|
||||
DROP TABLE out_num_cnt;
|
||||
drop table numbers_input;
|
||||
|
||||
Reference in New Issue
Block a user