mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Merge pull request #73017 from CurtizJ/add-test-for-block-number-mutation
Add tests for some mutations with enabled column `_block_number`
This commit is contained in:
commit
34b7207b76
@ -0,0 +1,2 @@
|
|||||||
|
5 5
|
||||||
|
2100-10-10 1 1
|
@ -0,0 +1,30 @@
|
|||||||
|
SET mutations_sync = 2;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS t_block_number_proj;
|
||||||
|
|
||||||
|
CREATE TABLE t_block_number_proj (a UInt64, b UInt64) ENGINE = MergeTree ORDER BY a
|
||||||
|
SETTINGS enable_block_number_column = 1, min_bytes_for_wide_part = 0, index_granularity = 128;
|
||||||
|
|
||||||
|
INSERT INTO t_block_number_proj SELECT number, number FROM numbers(1000);
|
||||||
|
|
||||||
|
OPTIMIZE TABLE t_block_number_proj FINAL;
|
||||||
|
|
||||||
|
ALTER TABLE t_block_number_proj ADD PROJECTION p (SELECT a, b ORDER BY b);
|
||||||
|
ALTER TABLE t_block_number_proj MATERIALIZE PROJECTION p;
|
||||||
|
|
||||||
|
SELECT a, b FROM t_block_number_proj WHERE b = 5 SETTINGS force_optimize_projection = 1;
|
||||||
|
|
||||||
|
DROP TABLE t_block_number_proj;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS t_block_number_ttl;
|
||||||
|
|
||||||
|
CREATE TABLE t_block_number_ttl (d Date, a UInt64, b UInt64) ENGINE = MergeTree ORDER BY a
|
||||||
|
SETTINGS enable_block_number_column = 1, min_bytes_for_wide_part = 0, index_granularity = 128;
|
||||||
|
|
||||||
|
INSERT INTO t_block_number_ttl VALUES ('2000-10-10', 1, 1) ('2100-10-10', 1, 1);
|
||||||
|
OPTIMIZE TABLE t_block_number_ttl FINAL;
|
||||||
|
|
||||||
|
ALTER TABLE t_block_number_ttl MODIFY TTL d + INTERVAL 1 MONTH;
|
||||||
|
SELECT * FROM t_block_number_ttl ORDER BY a;
|
||||||
|
|
||||||
|
DROP TABLE t_block_number_ttl;
|
Loading…
Reference in New Issue
Block a user