Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hi, The regex group capture for matching the TO database is missing i…
…n case the table names are enclosed in a "`". This further leads to wrong restore of materialized views(the TO still point to default database!). Restore command used: clickhouse-backup restore_remote --rm -m praveen:default <backup-name> For example:- If we run the following restore command, the resulting materialized view will be the following. CREATE MATERIALIZED VIEW praveen.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_mv_shard` TO default.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_mv_inner_shard` ( `__created_at` AggregateFunction(max, DateTime), `__occurred_at` DateTime, `environment_id` UUID, `aggregation` String, `value` AggregateFunction(sum, Float64) ) AS SELECT maxState(__created_at) AS __created_at, toStartOfFiveMinute(__occurred_at) AS __occurred_at, environment_id, aggregation, sumState(value) AS value FROM praveen.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_shard` GROUP BY environment_id, aggregation, __occurred_at ORDER BY environment_id ASC, aggregation ASC, __occurred_at ASC; The expected one:- CREATE MATERIALIZED VIEW praveen.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_mv_shard` TO praveen.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_mv_inner_shard` ( `__created_at` AggregateFunction(max, DateTime), `__occurred_at` DateTime, `environment_id` UUID, `aggregation` String, `value` AggregateFunction(sum, Float64) ) AS SELECT maxState(__created_at) AS __created_at, toStartOfFiveMinute(__occurred_at) AS __occurred_at, environment_id, aggregation, sumState(value) AS value FROM praveen.`32da477b_0eb9_4aa6_bcbb_7f511649861e_v0_5_min_shard` GROUP BY environment_id, aggregation, __occurred_at ORDER BY environment_id ASC, aggregation ASC, __occurred_at ASC;
- Loading branch information