-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails to add ON CLUSTER clause when SHOW CREATE TABLE contains \n #642
Comments
Could you share:
? |
Here is the log of the restore:
The backup was done like this:
And here is the config on the restore side:
|
Some comments about backup config: # slower freeze, default value `False`
# change to False
freeze_by_part: True
# unsafe when restore ReplicatedMergeTree, it could duplicate data,
# cause during ATTACH PART no part deduduplication apply
# change to True,
# use False only when you try to attach backup data to exists table with possible duplication,
# or attach only not exists partition)
check_replicas_before_attach: False Could you share |
Noted the comments on Here is the
|
Hi,
Description.
When using a restore command with the
restore_schema_on_cluster
option set,the DROP TABLE does work fine and the correct ON CLUSTER clause is being inserted,
but the next command CREATE TABLE doesn't have the ON CLUSTER clause.
If I look at the backup_name/metadata/db/table.json, I can see the table definition in the
"query"
sections contains\n
's, for example:"query": "CREATE TABLE db.table\n(\n col1 Date, ....
.I suspect that the regex is not not working properly when adding the ON CLUSTER clause because of these new line symbols. I haven't noticed this behaviour when the table definition doesn't contain new line symbols.
Versions used.
Clickhouse server 22.8.8.3
Clickhouse-backup 2.2.0-2.2.2.
Additional comments.
I don't quite understand how this happens, but the SHOW CREATE TABLE shows \n symbols, I am guessing this is due to how Clickhouse formats queries?
Nik.
The text was updated successfully, but these errors were encountered: