mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-20 15:00:40 +00:00
broken: try using logical plan fix: use dummy catalog for logical plan fix: insert plan exec&sqlness grpc addr feat: use frontend instance in flownode in standalone feat: flow type in metasrv&fix: flush flow out of sync& column name alias tests: sqlness update tests: sqlness flow rebuild udpate chore: per review refactor: keep chnl mgr refactor: use catalog mgr for get table tests: use valid sql fix: add more check refactor: put flow type determine to frontend
60 lines
1.2 KiB
SQL
60 lines
1.2 KiB
SQL
CREATE TABLE numbers_input_basic (
|
|
number INT,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(number),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
CREATE FLOW test_numbers_basic SINK TO out_num_cnt_basic AS
|
|
SELECT
|
|
sum(number),
|
|
date_bin(INTERVAL '1 second', ts, '2021-07-01 00:00:00') as time_window
|
|
FROM
|
|
numbers_input_basic
|
|
GROUP BY
|
|
time_window;
|
|
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
-- SQLNESS REPLACE (ADMIN\sFLUSH_FLOW\('\w+'\)\s+\|\n\+-+\+\n\|\s+)[0-9]+\s+\| $1 FLOW_FLUSHED |
|
|
ADMIN FLUSH_FLOW('test_numbers_basic');
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
SHOW CREATE FLOW test_numbers_basic;
|
|
|
|
DROP FLOW test_numbers_basic;
|
|
|
|
DROP TABLE numbers_input_basic;
|
|
|
|
DROP TABLE out_num_cnt_basic;
|
|
|
|
CREATE TABLE numbers_input_basic (
|
|
number INT,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(number),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
CREATE FLOW test_numbers_basic SINK TO out_num_cnt_basic AS
|
|
SELECT
|
|
sum(number) as sumup, ts as event_time
|
|
FROM
|
|
numbers_input_basic
|
|
GROUP BY
|
|
ts;
|
|
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE FLOW test_numbers_basic;
|
|
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
DROP FLOW test_numbers_basic;
|
|
|
|
DROP TABLE numbers_input_basic;
|
|
|
|
DROP TABLE out_num_cnt_basic;
|