Skip to content

Commit

Permalink
clickhouse: allow restoring experimental MergeTree settings
Browse files Browse the repository at this point in the history
The two settings were introduced between v23.8 and v24.3. They are needed when
restoring by clusters that have defined them at the table level.
  • Loading branch information
aris-aiven committed Dec 5, 2024
1 parent 973a590 commit 0d037bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions astacus/coordinator/plugins/clickhouse/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ def _create_dbs(client: ClickHouseClient) -> Iterator[Awaitable[None]]:
b"SET allow_hyperscan=true",
b"SET allow_simdjson=true",
b"SET allow_deprecated_syntax_for_merge_tree=true",
b"SET allow_experimental_block_number_column=true",
b"SET allow_experimental_replacing_merge_with_cleanup=true",
# If a table was created with flatten_nested=0, we must be careful to not re-create the
# table with flatten_nested=1, since this would recreate the table with a different schema.
# If a table was created with flatten_nested=1, the query in system.tables.create_table_query
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/coordinator/plugins/clickhouse/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,8 @@ async def test_creates_all_replicated_databases_and_tables_in_manifest() -> None
b"SET allow_hyperscan=true",
b"SET allow_simdjson=true",
b"SET allow_deprecated_syntax_for_merge_tree=true",
b"SET allow_experimental_block_number_column=true",
b"SET allow_experimental_replacing_merge_with_cleanup=true",
b"SET flatten_nested=0",
b"CREATE TABLE db-one.table-uno ...",
b"CREATE TABLE db-one.table-dos ...",
Expand Down Expand Up @@ -964,6 +966,8 @@ async def test_creates_all_replicated_databases_and_tables_in_manifest_with_cust
b"SET allow_hyperscan=true",
b"SET allow_simdjson=true",
b"SET allow_deprecated_syntax_for_merge_tree=true",
b"SET allow_experimental_block_number_column=true",
b"SET allow_experimental_replacing_merge_with_cleanup=true",
b"SET flatten_nested=0",
b"CREATE TABLE db-one.table-uno ...",
b"CREATE TABLE db-one.table-dos ...",
Expand Down Expand Up @@ -1023,6 +1027,8 @@ async def test_drops_each_database_on_all_servers_before_recreating_it() -> None
b"SET allow_hyperscan=true",
b"SET allow_simdjson=true",
b"SET allow_deprecated_syntax_for_merge_tree=true",
b"SET allow_experimental_block_number_column=true",
b"SET allow_experimental_replacing_merge_with_cleanup=true",
b"SET flatten_nested=0",
b"CREATE TABLE db-one.table-uno ...",
b"CREATE TABLE db-one.table-dos ...",
Expand Down

0 comments on commit 0d037bc

Please sign in to comment.