2024-01-09 01:22:40 +00:00
|
|
|
from helpers.cluster import ClickHouseCluster
|
|
|
|
|
|
|
|
|
2024-01-17 09:50:09 +00:00
|
|
|
def get_table_path(node, table, database):
|
2024-03-22 13:04:10 +00:00
|
|
|
return (
|
|
|
|
node.query(
|
|
|
|
sql=f"SELECT data_paths FROM system.tables WHERE table = '{table}' and database = '{database}' LIMIT 1"
|
|
|
|
)
|
|
|
|
.split(",")[0]
|
|
|
|
.strip("'[]\n")
|
|
|
|
)
|
2024-01-17 09:50:09 +00:00
|
|
|
|
|
|
|
|
2024-01-09 01:22:40 +00:00
|
|
|
def check_flags_deleted(node, database_name, tables):
|
|
|
|
for table in tables:
|
|
|
|
assert "convert_to_replicated" not in node.exec_in_container(
|
|
|
|
[
|
|
|
|
"bash",
|
|
|
|
"-c",
|
2024-01-17 09:50:09 +00:00
|
|
|
f"ls {get_table_path(node, table, database_name)}",
|
2024-01-09 01:22:40 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def set_convert_flags(node, database_name, tables):
|
|
|
|
for table in tables:
|
|
|
|
node.exec_in_container(
|
|
|
|
[
|
|
|
|
"bash",
|
|
|
|
"-c",
|
2024-01-17 09:50:09 +00:00
|
|
|
f"touch {get_table_path(node, table, database_name)}convert_to_replicated",
|
2024-01-09 01:22:40 +00:00
|
|
|
]
|
|
|
|
)
|