Fix error

This commit is contained in:
Alexey Milovidov 2024-01-19 17:02:23 +01:00
parent 05609cf75d
commit 639d7745d4

View File

@ -181,7 +181,7 @@ function setup_logs_replication
# Create the destination table with adapted name and structure:
statement=$(clickhouse-client --format TSVRaw --query "SHOW CREATE TABLE system.${table}" | sed -r -e '
s/^\($/('"$EXTRA_COLUMNS_FOR_TABLE"'/;
s/ORDER BY \(?(.+?)\)?/ORDER BY ('"$EXTRA_ORDER_BY_COLUMNS"', \1)/;
s/^ORDER BY \(?(.+?)\)?$/ORDER BY ('"$EXTRA_ORDER_BY_COLUMNS"', \1)/;
s/^CREATE TABLE system\.\w+_log$/CREATE TABLE IF NOT EXISTS '"$table"'_'"$hash"'/;
/^TTL /d
')