This commit is contained in:
attack204 2023-02-09 09:22:20 +08:00
parent e01fff0e37
commit 3a1e67dc8b
3 changed files with 32 additions and 7 deletions

View File

@ -1072,6 +1072,9 @@ CREATE TABLE system.tables
`storage_policy` String,
`total_rows` Nullable(UInt64),
`total_bytes` Nullable(UInt64),
`parts` Nullable(UInt64),
`active_parts` Nullable(UInt64),
`total_marks` Nullable(UInt64),
`lifetime_rows` Nullable(UInt64),
`lifetime_bytes` Nullable(UInt64),
`comment` String,

View File

@ -1,5 +1,27 @@
DROP TABLE IF EXISTS json_columns;
-- Check MergeTree declaration in new format
CREATE TABLE check_system_tables
(
name1 UInt8,
name2 UInt8,
name3 UInt8
) ENGINE = MergeTree()
ORDER BY name1
PARTITION BY name2
SAMPLE BY name1
SETTINGS min_bytes_for_wide_part = 0, compress_marks=false, compress_primary_key=false;
CREATE TABLE json_columns (n UInt32, s String) ENGINE = MergeTree order by n;
SELECT parts, active_parts,total_marks FROM system.tables WHERE name = 'check_system_tables' AND database = currentDatabase();
SELECT * FROM json_columns FORMAT JSONColumns;
INSERT INTO check_system_tables VALUES (1, 1, 1);
SELECT parts, active_parts,total_marks FROM system.tables WHERE name = 'check_system_tables' AND database = currentDatabase();
INSERT INTO check_system_tables VALUES (1, 2, 1);
SELECT parts, active_parts,total_marks FROM system.tables WHERE name = 'check_system_tables' AND database = currentDatabase();
ALTER TABLE check_system_tables DETACH PARTITION 1;
SELECT parts, active_parts,total_marks FROM system.tables WHERE name = 'check_system_tables' AND database = currentDatabase();
DROP TABLE IF EXISTS check_system_tables;

View File

@ -1,4 +1,4 @@
0 0 0
1 1 2
2 2 4
2 1 2
0 0 0
1 1 2
2 2 4
2 1 2