Help Center/ MapReduce Service/ Troubleshooting/ Using ClickHouse/ An Error Is Reported During ClickHouse Data Migration
Updated on 2025-08-19 GMT+08:00

An Error Is Reported During ClickHouse Data Migration

Symptom

Data migration in a ClickHouse cluster fails, and the following error information is displayed:

<Error> ClusterCopier: Will retry: Code: 62, e.displayText() = DB::Exception: Syntax error (Query): failed at position 122 ('000001677E49EA7C'): 000001677E49EA7C')' AS partition_key)) AND (1 = 1) LIMIT 1. Expected one of: IN, AND, OR, alias, NOT, AS, IS, token, Comma, BETWEEN, ILIKE, LIKE, comma or closing bracket, NOT LIKE, NOT ILIKE, NOT IN, GLOBAL IN, GLOBAL NOT IN, MOD, DIV, QuestionMark, Stack trace (when copying this message, always include the lines below)

Cause Analysis

The partition key of the table to be migrated is PARTITION BY (date_p, app_key), which is a tuple. Quotation marks are added to the partition in the description configuration, which will be uploaded to ZooKeeper, during copier task configuration. As a result, data migration fails.

Solution

  1. Delete the single quotation marks from the partition name in the enabled_partitions label of the description of the data migration task in ZooKeeper.

    The path is /clickhouse/copier_tasks/{Task name}/description.

  2. Start the migration task on Manager again.