mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 21:32:58 +00:00
* feat: use flow batching engine 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 * chore: update proto * chore: update proto to main branch * fix: add locks for create/drop flow&docs: update docs * feat: flush_flow flush all ranges now * test: add align time window test * docs: explain `nodeid` use in check task * refactor: AddAutoColumnRewriter check for Projection * refactor: per review * fix: query without time window also clean dirty time window * chore: better logging * chore: add comments per review * refactor: per review * chore: per review * chore: per review rename args * refactor: per review partially * chore: update docs * chore: use better error variant * chore: better error variant * refactor: rename FlowWorkerManager to FlowStreamingEngine * rename again * refactor: per review * chore: rebase after #5963 merged * refactor: rename all flow_worker_manager occurs * docs: rm resolved TODO
159 lines
7.2 KiB
Plaintext
159 lines
7.2 KiB
Plaintext
CREATE TABLE numbers_input_basic (
|
|
number INT,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(number),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
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;
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
+-------------------+--------------------------------------------------+
|
|
| Table | Create Table |
|
|
+-------------------+--------------------------------------------------+
|
|
| out_num_cnt_basic | CREATE TABLE IF NOT EXISTS "out_num_cnt_basic" ( |
|
|
| | "sum(numbers_input_basic.number)" BIGINT NULL, |
|
|
| | "time_window" TIMESTAMP(9) NOT NULL, |
|
|
| | "update_at" TIMESTAMP(3) NULL, |
|
|
| | TIME INDEX ("time_window") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+-------------------+--------------------------------------------------+
|
|
|
|
-- SQLNESS REPLACE (ADMIN\sFLUSH_FLOW\('\w+'\)\s+\|\n\+-+\+\n\|\s+)[0-9]+\s+\| $1 FLOW_FLUSHED |
|
|
ADMIN FLUSH_FLOW('test_numbers_basic');
|
|
|
|
+----------------------------------------+
|
|
| ADMIN FLUSH_FLOW('test_numbers_basic') |
|
|
+----------------------------------------+
|
|
| FLOW_FLUSHED |
|
|
+----------------------------------------+
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
+-------------------+--------------------------------------------------+
|
|
| Table | Create Table |
|
|
+-------------------+--------------------------------------------------+
|
|
| out_num_cnt_basic | CREATE TABLE IF NOT EXISTS "out_num_cnt_basic" ( |
|
|
| | "sum(numbers_input_basic.number)" BIGINT NULL, |
|
|
| | "time_window" TIMESTAMP(9) NOT NULL, |
|
|
| | "update_at" TIMESTAMP(3) NULL, |
|
|
| | TIME INDEX ("time_window") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+-------------------+--------------------------------------------------+
|
|
|
|
SHOW CREATE FLOW test_numbers_basic;
|
|
|
|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| Flow | Create Flow |
|
|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| test_numbers_basic | CREATE FLOW IF NOT EXISTS 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 |
|
|
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
DROP FLOW test_numbers_basic;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE numbers_input_basic;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE out_num_cnt_basic;
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE numbers_input_basic (
|
|
number INT,
|
|
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY(number),
|
|
TIME INDEX(ts)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
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;
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE out_num_cnt_basic;
|
|
|
|
+-------------------+--------------------------------------------------+
|
|
| Table | Create Table |
|
|
+-------------------+--------------------------------------------------+
|
|
| out_num_cnt_basic | CREATE TABLE IF NOT EXISTS "out_num_cnt_basic" ( |
|
|
| | "sumup" BIGINT NULL, |
|
|
| | "event_time" TIMESTAMP(3) NOT NULL, |
|
|
| | "update_at" TIMESTAMP(3) NULL, |
|
|
| | TIME INDEX ("event_time") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+-------------------+--------------------------------------------------+
|
|
|
|
-- SQLNESS ARG restart=true
|
|
SHOW CREATE FLOW test_numbers_basic;
|
|
|
|
+--------------------+---------------------------------------------------------------------------------------+
|
|
| Flow | Create Flow |
|
|
+--------------------+---------------------------------------------------------------------------------------+
|
|
| test_numbers_basic | CREATE FLOW IF NOT EXISTS 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;
|
|
|
|
+-------------------+--------------------------------------------------+
|
|
| Table | Create Table |
|
|
+-------------------+--------------------------------------------------+
|
|
| out_num_cnt_basic | CREATE TABLE IF NOT EXISTS "out_num_cnt_basic" ( |
|
|
| | "sumup" BIGINT NULL, |
|
|
| | "event_time" TIMESTAMP(3) NOT NULL, |
|
|
| | "update_at" TIMESTAMP(3) NULL, |
|
|
| | TIME INDEX ("event_time") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+-------------------+--------------------------------------------------+
|
|
|
|
DROP FLOW test_numbers_basic;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE numbers_input_basic;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE out_num_cnt_basic;
|
|
|
|
Affected Rows: 0
|
|
|