Dumpling --where Condition Filter Format Error

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: Dumpling --where条件筛选格式错误

| username: 普罗米修斯

【TiDB Usage Environment】
Production Environment
【TiDB Version】
V5.2.4
【Encountered Problem: Problem Phenomenon and Impact】
Need to export data from the HealthStatus_Fusion_Result table in the wtlivedbrds_xa database where EntityType != “MeasureLocation_Feature”, but there is a syntax error.


Please help to check how to write the correct condition after --where.

| username: tidb狂热爱好者 | Original post link

dump failed: sql: SELECT * FROM wtlivedbrds_xa.HealthStatus_Fusion_Result WHERE EntityType != ‘MeasureLocation_Feature’ AND _tidb_rowid>=1 and _tidb_rowid<174329 ORDER BY _tidb_rowid: Error 1054: Unknown column ‘measurelocation_feature’ in ‘where clause’

| username: 普罗米修斯 | Original post link

It worked, boss. I have another question:

  1. After exporting the data, I want to import the exported SQL into another new table in the database (with the same structure as the exported table). I modified the table creation SQL inside to match the table I want to import into. Is this the correct way to do it?
  2. The exported SQL also includes a database creation SQL. Since I want to import it into the original database, will this database creation SQL affect anything? Do I need to delete this database creation SQL?
| username: zhanggame1 | Original post link

Take a look and study it. I’ve been researching data export and import these past few days.

| username: 普罗米修斯 | Original post link

Change the names of all the SQL files downloaded by Dumpling to the names of the tables to be imported, and also change the table names inside the SQL files. Move the SQL for creating the database out, but when executing Lightning, it still reports an error requiring this database creation SQL. How can I ignore this? The database already exists.

| username: tidb狂热爱好者 | Original post link

You renamed the database.

| username: 普罗米修斯 | Original post link

Changing the database name will not achieve the purpose of export and import. It will return to normal after modifying the configuration file in Lightning.

| username: 普罗米修斯 | Original post link

It can also be achieved using lightning routing, I will test it later.

| username: zhanggame1 | Original post link

First, create an empty table directly in TiDB, then set [mydumper] no-schema = true in tidb-lightning.toml.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.