feat: add tests

This commit is contained in:
skyoct 2023-12-14 14:45:13 +00:00
parent 0a4882d781
commit f52c4d0a83
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,8 @@
Expression ((Projection + Before ORDER BY))
MergingAggregated
ReadFromPreparedSource (Optimized trivial count)
2
Expression ((Projection + Before ORDER BY))
Aggregating
Expression (Before GROUP BY)
ReadFromMerge

View File

@ -0,0 +1,27 @@
DROP TABLE IF EXISTS mt1;
DROP TABLE IF EXISTS mt2;
DROP TABLE IF EXISTS merge;
CREATE TABLE mt1 (id UInt64) ENGINE = MergeTree ORDER BY id;
CREATE TABLE mt2 (id UInt64) ENGINE = MergeTree ORDER BY id;
CREATE TABLE merge (id UInt64) ENGINE = Merge(currentDatabase(), '^mt[0-9]+$');
INSERT INTO mt1 VALUES (1);
INSERT INTO mt2 VALUES (1);
EXPLAIN SELECT count() FROM merge;
SELECT count() FROM merge;
CREATE TABLE mt3 (id UInt64) ENGINE = TinyLog;
INSERT INTO mt2 VALUES (2);
EXPLAIN SELECT count() FROM merge;
DROP TABLE IF EXISTS mt1;
DROP TABLE IF EXISTS mt2;
DROP TABLE IF EXISTS mt3;
DROP TABLE IF EXISTS merge;