better tests

This commit is contained in:
Yatsishin Ilya 2022-02-07 12:38:54 +00:00
parent e0803064e6
commit d5a2f725c2
2 changed files with 10 additions and 1012 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,15 +19,19 @@ CREATE TABLE table_02184 (x UInt8) PRIMARY KEY x;
SHOW CREATE TABLE table_02184; SHOW CREATE TABLE table_02184;
DROP TABLE table_02184; DROP TABLE table_02184;
SET default_table_engine = 'Memory'; SET default_table_engine = 'Memory';
CREATE TABLE numbers1 AS SELECT number FROM numbers(1000); CREATE TABLE numbers1 AS SELECT number FROM numbers(10);
SHOW CREATE TABLE numbers1; SHOW CREATE TABLE numbers1;
SELECT * FROM numbers1; SELECT avg(number) FROM numbers1;
DROP TABLE numbers1; DROP TABLE numbers1;
SET default_table_engine = 'MergeTree'; SET default_table_engine = 'MergeTree';
CREATE TABLE numbers2 ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(10); CREATE TABLE numbers2 ORDER BY intHash32(number) SAMPLE BY intHash32(number) AS SELECT number FROM numbers(10);
SELECT * FROM numbers2; SELECT sum(number) FROM numbers2;
SHOW CREATE TABLE numbers2; SHOW CREATE TABLE numbers2;
DROP TABLE numbers2; DROP TABLE numbers2;
CREATE TABLE numbers3 ENGINE = Log AS SELECT number FROM numbers(10);
SELECT sum(number) FROM numbers3;
SHOW CREATE TABLE numbers3;
DROP TABLE numbers3;
CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime('Europe/Moscow'), UTCEventTime DateTime('UTC')) PARTITION BY EventDate PRIMARY KEY CounterID; CREATE TABLE test_table (EventDate Date, CounterID UInt32, UserID UInt64, EventTime DateTime('Europe/Moscow'), UTCEventTime DateTime('UTC')) PARTITION BY EventDate PRIMARY KEY CounterID;
SET default_table_engine = 'Memory'; SET default_table_engine = 'Memory';
CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime('Europe/Moscow')) AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table; CREATE MATERIALIZED VIEW test_view (Rows UInt64, MaxHitTime DateTime('Europe/Moscow')) AS SELECT count() AS Rows, max(UTCEventTime) AS MaxHitTime FROM test_table;