2024-09-06 13:50:13 +00:00
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
|
|
def randomize_settings():
|
|
|
|
yield "max_joined_block_size_rows", random.randint(8000, 100000)
|
|
|
|
if random.random() < 0.5:
|
|
|
|
yield "max_block_size", random.randint(8000, 100000)
|
2024-09-25 09:25:38 +00:00
|
|
|
if random.random() < 0.5:
|
2024-09-26 13:34:25 +00:00
|
|
|
yield "query_plan_join_inner_table_selection", random.choice(
|
|
|
|
["auto", "left", "right"]
|
|
|
|
)
|
2024-09-06 13:50:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
def write_random_settings_config(destination):
|
|
|
|
with open(destination, "w") as f:
|
|
|
|
f.write(
|
|
|
|
"""
|
|
|
|
<clickhouse>
|
|
|
|
<profiles>
|
|
|
|
<default>
|
|
|
|
"""
|
|
|
|
)
|
|
|
|
for setting, value in randomize_settings():
|
|
|
|
f.write(f"<{setting}>{value}</{setting}>\n")
|
|
|
|
|
|
|
|
f.write(
|
|
|
|
"""
|
|
|
|
</default>
|
|
|
|
</profiles>
|
|
|
|
</clickhouse>
|
|
|
|
"""
|
|
|
|
)
|