From f3eb40fc9c39f6e3cccc521266c1050ba56424cd Mon Sep 17 00:00:00 2001 From: zhongyuankai <872237106@qq.com> Date: Tue, 30 Aug 2022 09:32:27 +0800 Subject: [PATCH] Combine 02416_compress_marks_dynamic tests --- .../02381_compress_marks_and_primary_key.sql | 36 ++++++++++--------- .../02416_compress_marks_dynamic.reference | 0 .../02416_compress_marks_dynamic.sql | 12 ------- 3 files changed, 19 insertions(+), 29 deletions(-) delete mode 100644 tests/queries/0_stateless/02416_compress_marks_dynamic.reference delete mode 100644 tests/queries/0_stateless/02416_compress_marks_dynamic.sql diff --git a/tests/queries/0_stateless/02381_compress_marks_and_primary_key.sql b/tests/queries/0_stateless/02381_compress_marks_and_primary_key.sql index 158fed0dc14..b929c9a3a2d 100644 --- a/tests/queries/0_stateless/02381_compress_marks_and_primary_key.sql +++ b/tests/queries/0_stateless/02381_compress_marks_and_primary_key.sql @@ -8,13 +8,14 @@ create table test_02381_compress(a UInt64, b UInt64) ENGINE = MergeTree order by insert into test_02381_compress select number, number * 10 from system.numbers limit 1000000; select * from test_02381_compress where a = 1000 limit 1; -OPTIMIZE TABLE test_02381_compress FINAL; +optimize table test_02381_compress final; select * from test_02381_compress where a = 1000 limit 1; -- Compare the size of marks on disk select table, sum(rows), sum(bytes_on_disk) sum_bytes, sum(marks_bytes) sum_marks_bytes, (sum_bytes - sum_marks_bytes) exclude_marks from system.parts_columns where active and database = currentDatabase() and table like 'test_02381%' group by table order by table; --- switch to compressed and uncompressed +-- Switch to compressed and uncompressed +-- Test wide part alter table test_02381 modify setting compress_marks=true, compress_primary_key=true; insert into test_02381 select number, number * 10 from system.numbers limit 1000000; @@ -22,27 +23,28 @@ alter table test_02381_compress modify setting compress_marks=false, compress_pr insert into test_02381_compress select number, number * 10 from system.numbers limit 1000000; select * from test_02381_compress where a = 10000 limit 1; -OPTIMIZE TABLE test_02381_compress FINAL; +optimize table test_02381_compress final; select * from test_02381_compress where a = 10000 limit 1; select * from test_02381 where a = 10000 limit 1; -OPTIMIZE TABLE test_02381 FINAL; +optimize table test_02381 final; select * from test_02381 where a = 10000 limit 1; select table, sum(rows), sum(bytes_on_disk) sum_bytes, sum(marks_bytes) sum_marks_bytes, (sum_bytes - sum_marks_bytes) exclude_marks from system.parts_columns where active and database = currentDatabase() and table like 'test_02381%' group by table order by table; -DROP TABLE IF EXISTS test; -CREATE TABLE test (a UInt64, b String) ENGINE = MergeTree order by (a, b); - -INSERT INTO test VALUES (1, 'Hello'); -ALTER TABLE test MODIFY SETTING compress_marks = true, compress_primary_key = true; -INSERT INTO test VALUES (2, 'World'); - -SELECT * FROM test ORDER BY a; -OPTIMIZE TABLE test FINAL; -SELECT * FROM test ORDER BY a; - -DROP TABLE test; - drop table if exists test_02381; drop table if exists test_02381_compress; + +-- Test compact part +drop table if exists test_02381_compact; +create table test_02381_compact (a UInt64, b String) ENGINE = MergeTree order by (a, b); + +insert into test_02381_compact values (1, 'Hello'); +alter table test_02381_compact modify setting compress_marks = true, compress_primary_key = true; +insert into test_02381_compact values (2, 'World'); + +select * from test_02381_compact order by a; +optimize table test_02381_compact final; +select * from test_02381_compact order by a; + +drop table if exists test_02381_compact; diff --git a/tests/queries/0_stateless/02416_compress_marks_dynamic.reference b/tests/queries/0_stateless/02416_compress_marks_dynamic.reference deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/queries/0_stateless/02416_compress_marks_dynamic.sql b/tests/queries/0_stateless/02416_compress_marks_dynamic.sql deleted file mode 100644 index f91d0ef19c6..00000000000 --- a/tests/queries/0_stateless/02416_compress_marks_dynamic.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS test; -CREATE TABLE test (a UInt64, b String) ENGINE = MergeTree order by (a, b); - -INSERT INTO test VALUES (1, 'Hello'); -ALTER TABLE test MODIFY SETTING compress_marks = true, compress_primary_key = true; -INSERT INTO test VALUES (2, 'World'); - -SELECT * FROM test ORDER BY a; -OPTIMIZE TABLE test FINAL; -SELECT * FROM test ORDER BY a; - -DROP TABLE test;