Skip to content

Commit 12f81b3

Browse files
Add comments.
1 parent 8e429c4 commit 12f81b3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • tests/integration/test_projection_rebuild_with_required_columns

tests/integration/test_projection_rebuild_with_required_columns/test.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,21 @@ def started_cluster():
1919

2020

2121
def test_projection_rebuild_uses_only_required_columns(started_cluster):
22+
# Here we check that projection rebuild does not create too many temporary parts.
23+
# The size of temporary projection part is limited by min_insert_block_size_bytes/min_insert_block_size_rows, so they are changed in the config.
24+
2225
node1.query("drop table if exists tab")
2326
node1.query("create table tab (x UInt64, y UInt64, data String codec(NONE), v UInt8, projection p (select _part_offset order by y)) engine = ReplacingMergeTree(v) order by x settings allow_part_offset_column_in_projections=1, deduplicate_merge_projection_mode='rebuild';")
27+
# Here we expect 3 parts to be inserted, contrilled by max_block_size=min_insert_block_size_rows=10000
2428
node1.query("insert into tab select number, number, rightPad('', 100, 'a'), 0 from numbers(30000) settings max_block_size=10000;")
29+
# Here we merge parts, and projections should be rebuild
30+
# Initially we kept `data` column in projection squash, ~10 temporary parts were created by min_insert_block_size_bytes limit
2531
node1.query("optimize table tab final settings mutations_sync=2, alter_sync=2;")
2632
node1.query("system flush logs;")
2733

2834
uuid = node1.query("select uuid from system.tables where table = 'tab';").strip()
2935
cnt = node1.query("select count() from system.text_log where query_id like '{}::all_%_2' and message like '%Reading%from part p_%from the beginning of the part%'".format(uuid))
36+
# One projection part per source part
3037
assert (cnt == '3\n')
31-
38+
# Here we check that _parent_part_offset is calculated properly. It was fixed in https://github.com/ClickHouse/ClickHouse/pull/93827
3239
assert(node1.query("select min(_parent_part_offset), max(_parent_part_offset) from mergeTreeProjection(default, tab, 'p')") == '0\t29999\n')

0 commit comments

Comments
 (0)