diff --git a/tests/cases/standalone/common/flow/basic.result b/tests/cases/standalone/common/flow/basic.result deleted file mode 100644 index 77f3b8683bfe..000000000000 --- a/tests/cases/standalone/common/flow/basic.result +++ /dev/null @@ -1,105 +0,0 @@ -CREATE TABLE numbers_input ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - -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'); - -Affected Rows: 0 - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -+-------+---------------------+---------------------+ - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -| 47 | 2021-07-01T00:00:01 | 2021-07-01T00:00:02 | -+-------+---------------------+---------------------+ - -DROP FLOW test_numbers; - -Affected Rows: 0 - -DROP TABLE numbers_input; - -Affected Rows: 0 - -DROP TABLE out_num_cnt; - -Affected Rows: 0 - --- test interprete interval -CREATE TABLE numbers_input ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - -create table out_num_cnt ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP TIME INDEX); - -Affected Rows: 0 - -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; - -Affected Rows: 0 - -SHOW CREATE FLOW filter_numbers; - -+----------------+----------------------------------------------------------------------------------------------------------------------------------------+ -| Flow | Create Flow | -+----------------+----------------------------------------------------------------------------------------------------------------------------------------+ -| filter_numbers | CREATE OR REPLACE FLOW IF NOT EXISTS 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 | -+----------------+----------------------------------------------------------------------------------------------------------------------------------------+ - -drop flow filter_numbers; - -Affected Rows: 0 - -drop table out_num_cnt; - -Affected Rows: 0 - -drop table numbers_input; - -Affected Rows: 0 - diff --git a/tests/cases/standalone/common/flow/basic.sql b/tests/cases/standalone/common/flow/basic.sql deleted file mode 100644 index ddef6cff9f5d..000000000000 --- a/tests/cases/standalone/common/flow/basic.sql +++ /dev/null @@ -1,55 +0,0 @@ -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'); - --- SQLNESS SLEEP 500ms -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; - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt; - -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 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; - -SHOW CREATE FLOW filter_numbers; - -drop flow filter_numbers; - -drop table out_num_cnt; - -drop table numbers_input; diff --git a/tests/cases/standalone/common/flow/df_func.result b/tests/cases/standalone/common/flow/df_func.result deleted file mode 100644 index 9f209a33da20..000000000000 --- a/tests/cases/standalone/common/flow/df_func.result +++ /dev/null @@ -1,258 +0,0 @@ -CREATE TABLE numbers_input_df_func ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - --- call `sum(abs(number))` where `abs` is DataFusion Function and `sum` is flow function -CREATE FLOW test_numbers_df_func -SINK TO out_num_cnt_df_func -AS -SELECT sum(abs(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); - -Affected Rows: 0 - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (-20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - -Affected Rows: 2 - --- sleep a little bit longer to make sure that table is created and data is inserted --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -+-------+---------------------+---------------------+ - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (23,"2021-07-01 00:00:01.000"), - (-24,"2021-07-01 00:00:01.500"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 42 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -| 47 | 2021-07-01T00:00:01 | 2021-07-01T00:00:02 | -+-------+---------------------+---------------------+ - -DROP FLOW test_numbers_df_func; - -Affected Rows: 0 - -DROP TABLE numbers_input_df_func; - -Affected Rows: 0 - -DROP TABLE out_num_cnt_df_func; - -Affected Rows: 0 - -CREATE TABLE numbers_input_df_func ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - --- call `abs(sum(number))`to make sure that calling `abs` function(impl by datafusion) on `sum` function(impl by flow) is working -CREATE FLOW test_numbers_df_func -SINK TO out_num_cnt_df_func -AS -SELECT abs(sum(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); - -Affected Rows: 0 - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (-20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - -Affected Rows: 2 - --- sleep a little bit longer to make sure that table is created and data is inserted --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 2 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -+-------+---------------------+---------------------+ - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (23,"2021-07-01 00:00:01.000"), - (-24,"2021-07-01 00:00:01.500"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -+-------+---------------------+---------------------+ -| col_0 | window_start | window_end | -+-------+---------------------+---------------------+ -| 2 | 2021-07-01T00:00:00 | 2021-07-01T00:00:01 | -| 1 | 2021-07-01T00:00:01 | 2021-07-01T00:00:02 | -+-------+---------------------+---------------------+ - -DROP FLOW test_numbers_df_func; - -Affected Rows: 0 - -DROP TABLE numbers_input_df_func; - -Affected Rows: 0 - -DROP TABLE out_num_cnt_df_func; - -Affected Rows: 0 - --- test date_bin -CREATE TABLE numbers_input ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - -CREATE FLOW test_numbers -SINK TO out_num_cnt -AS -SELECT max(number) - min(number), date_bin(INTERVAL '1 second', ts, '2021-07-01 00:00:00'::TimestampNanosecond) FROM numbers_input GROUP BY date_bin(INTERVAL '1 second', ts, '2021-07-01 00:00:00'::TimestampNanosecond); - -Affected Rows: 0 - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -+-------+---------------------+ -| col_0 | col_1 | -+-------+---------------------+ -| 2 | 2021-07-01T00:00:00 | -+-------+---------------------+ - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -+-------+---------------------+ -| col_0 | col_1 | -+-------+---------------------+ -| 2 | 2021-07-01T00:00:00 | -| 1 | 2021-07-01T00:00:01 | -+-------+---------------------+ - -DROP FLOW test_numbers; - -Affected Rows: 0 - -DROP TABLE numbers_input; - -Affected Rows: 0 - -DROP TABLE out_num_cnt; - -Affected Rows: 0 - --- test date_trunc -CREATE TABLE numbers_input ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - -Affected Rows: 0 - -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); - -Affected Rows: 0 - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -+---------------------+-------+ -| col_0 | col_1 | -+---------------------+-------+ -| 2021-07-01T00:00:00 | 42 | -+---------------------+-------+ - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - -Affected Rows: 2 - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -+---------------------+-------+ -| col_0 | col_1 | -+---------------------+-------+ -| 2021-07-01T00:00:00 | 42 | -| 2021-07-01T00:00:01 | 47 | -+---------------------+-------+ - -DROP FLOW test_numbers; - -Affected Rows: 0 - -DROP TABLE numbers_input; - -Affected Rows: 0 - -DROP TABLE out_num_cnt; - -Affected Rows: 0 - diff --git a/tests/cases/standalone/common/flow/df_func.sql b/tests/cases/standalone/common/flow/df_func.sql deleted file mode 100644 index b3c035a120f1..000000000000 --- a/tests/cases/standalone/common/flow/df_func.sql +++ /dev/null @@ -1,142 +0,0 @@ -CREATE TABLE numbers_input_df_func ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - --- call `sum(abs(number))` where `abs` is DataFusion Function and `sum` is flow function -CREATE FLOW test_numbers_df_func -SINK TO out_num_cnt_df_func -AS -SELECT sum(abs(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (-20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - --- sleep a little bit longer to make sure that table is created and data is inserted --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (23,"2021-07-01 00:00:01.000"), - (-24,"2021-07-01 00:00:01.500"); - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -DROP FLOW test_numbers_df_func; -DROP TABLE numbers_input_df_func; -DROP TABLE out_num_cnt_df_func; - -CREATE TABLE numbers_input_df_func ( - number INT, - ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY(number), - TIME INDEX(ts) -); - --- call `abs(sum(number))`to make sure that calling `abs` function(impl by datafusion) on `sum` function(impl by flow) is working -CREATE FLOW test_numbers_df_func -SINK TO out_num_cnt_df_func -AS -SELECT abs(sum(number)) FROM numbers_input_df_func GROUP BY tumble(ts, '1 second', '2021-07-01 00:00:00'); - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (-20, "2021-07-01 00:00:00.200"), - (22, "2021-07-01 00:00:00.600"); - --- sleep a little bit longer to make sure that table is created and data is inserted --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input_df_func -VALUES - (23,"2021-07-01 00:00:01.000"), - (-24,"2021-07-01 00:00:01.500"); - --- SQLNESS SLEEP 3s -SELECT col_0, window_start, window_end FROM out_num_cnt_df_func; - -DROP FLOW test_numbers_df_func; -DROP TABLE numbers_input_df_func; -DROP TABLE out_num_cnt_df_func; - --- test date_bin -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 max(number) - min(number), date_bin(INTERVAL '1 second', ts, '2021-07-01 00:00:00'::TimestampNanosecond) FROM numbers_input GROUP BY date_bin(INTERVAL '1 second', ts, '2021-07-01 00:00:00'::TimestampNanosecond); - --- SQLNESS SLEEP 500ms -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, col_1 FROM out_num_cnt; - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -DROP FLOW test_numbers; -DROP TABLE numbers_input; -DROP TABLE out_num_cnt; - - --- test date_trunc -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 date_trunc('second', ts), sum(number) FROM numbers_input GROUP BY date_trunc('second', ts); - --- SQLNESS SLEEP 500ms -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, col_1 FROM out_num_cnt; - --- SQLNESS SLEEP 500ms -INSERT INTO numbers_input -VALUES - (23,"2021-07-01 00:00:01.000"), - (24,"2021-07-01 00:00:01.500"); - --- SQLNESS SLEEP 3s -SELECT col_0, col_1 FROM out_num_cnt; - -DROP FLOW test_numbers; -DROP TABLE numbers_input; -DROP TABLE out_num_cnt; diff --git a/tests/cases/standalone/optimizer/last_value.result b/tests/cases/standalone/optimizer/last_value.result index 6824916d9b7c..aa9163f1d01d 100644 --- a/tests/cases/standalone/optimizer/last_value.result +++ b/tests/cases/standalone/optimizer/last_value.result @@ -20,10 +20,13 @@ insert into t values Affected Rows: 9 +-- SQLNESS REPLACE (-+) - +-- SQLNESS REPLACE (\s\s+) _ +-- SQLNESS REPLACE (elapsed_compute.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED +-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (metrics.*) REDACTED -- SQLNESS REPLACE (partitioning.*) REDACTED --- SQLNESS REPLACE \-+ --- SQLNESS REPLACE (\s\s+) _ explain analyze select last_value(host order by ts), @@ -32,10 +35,10 @@ explain analyze from t group by host; -++++ ++-+-+-+ | stage | node | plan_| -++++ -| 0_| 0_|_MergeScanExec: peers=[5695126634496(1326, 0), ] REDACTED ++-+-+-+ +| 0_| 0_|_MergeScanExec: REDACTED |_|_|_| | 1_| 0_|_ProjectionExec: expr=[last_value(t.host) ORDER BY [t.ts ASC NULLS LAST]@1 as last_value(t.host) ORDER BY [t.ts ASC NULLS LAST], last_value(t.not_pk) ORDER BY [t.ts ASC NULLS LAST]@2 as last_value(t.not_pk) ORDER BY [t.ts ASC NULLS LAST], last_value(t.val) ORDER BY [t.ts ASC NULLS LAST]@3 as last_value(t.val) ORDER BY [t.ts ASC NULLS LAST]] REDACTED |_|_|_AggregateExec: mode=FinalPartitioned, gby=[host@0 as host], aggr=[last_value(t.host) ORDER BY [t.ts ASC NULLS LAST], last_value(t.not_pk) ORDER BY [t.ts ASC NULLS LAST], last_value(t.val) ORDER BY [t.ts ASC NULLS LAST]] REDACTED @@ -47,7 +50,7 @@ explain analyze |_|_|_SeqScan: partition_count=1 (1 memtable ranges, 0 file ranges), selector=LastRow REDACTED |_|_|_| |_|_| Total rows: 4_| -++++ ++-+-+-+ drop table t; diff --git a/tests/cases/standalone/optimizer/last_value.sql b/tests/cases/standalone/optimizer/last_value.sql index 3b34c4de38b9..903551d3b967 100644 --- a/tests/cases/standalone/optimizer/last_value.sql +++ b/tests/cases/standalone/optimizer/last_value.sql @@ -16,10 +16,13 @@ insert into t values (7, 'c', '🌔', 8.0), (8, 'd', '🌕', 9.0); +-- SQLNESS REPLACE (-+) - +-- SQLNESS REPLACE (\s\s+) _ +-- SQLNESS REPLACE (elapsed_compute.*) REDACTED +-- SQLNESS REPLACE (peers.*) REDACTED +-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED -- SQLNESS REPLACE (metrics.*) REDACTED -- SQLNESS REPLACE (partitioning.*) REDACTED --- SQLNESS REPLACE \-+ --- SQLNESS REPLACE (\s\s+) _ explain analyze select last_value(host order by ts),