mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-15 20:24:07 +00:00
29 lines
588 B
Python
29 lines
588 B
Python
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)
|
|
|
|
|
|
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>
|
|
"""
|
|
)
|