Altinity / clickhouse-backup

Tool for easy ClickHouse backup and restore using object storage for backup files.

Home Page:https://altinity.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

freeze_by_part_where got an error

and1990 opened this issue · comments

Hi, I appreciate that you offered this such an excellent tool. Thanks.

When I back up some specific partitions with 'freeze_by_part_where', I got an error, the message is below.

error can't get partitions for 'solar.events': code: 62, message: Syntax error: failed at position 94 ('name'): name LIKE '02a5d0453f5f69f16493f3074ef4b183' || '%' AND active = 1. Expected one of: token, DoubleColon, OR, AND, IS NOT DISTINCT FROM, IS NULL, IS NOT NULL, BETWEEN, NOT BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, REGEXP, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, MOD, DIV, alias, AS, GROUP BY, WITH, HAVING, WINDOW, ORDER BY, LIMIT, OFFSET, FETCH, SETTINGS, UNION, EXCEPT, INTERSECT, INTO OUTFILE, FORMAT, end of query

And my config is like this.

freeze_by_part: true
freeze_by_part_where: "name LIKE concat('02a5d0453f5f69f16493f3074ef4b183','%') AND active=1"

The backup command is:
clickhouse-backup create solar_s3_0301_0751 --tables=solar.events

The clickhouse-backup version is 2.3.0

Well, I found out how to solve this problem, add an "And", like this And name LIKE concat('02a5d0453f5f69f16493f3074ef4b183','%') AND active=1.

But I am confused, because I referred to the answer you offered in this issue #579, and you did not add the 'And'.

Did the code get modified or did you forget to add the "And" in the answer?

thanks you for reporting
looks like i was wrong in referenced comment and AND is required now
will fix these behavior in 2.5.0