apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.7k stars 3.28k forks source link

[Bug] binlog 同步字段映射报语法错误 #7352

Open yhp353134 opened 2 years ago

yhp353134 commented 2 years ago

Search before asking

Version

apache 0.15 release版本

What's Wrong?

创建了一张表,通过canal同步数据 CREATE TABLE test_doris2 ( id int(10), name varchar(255), create_at datetime, update_at datetime ) ENGINE =OLAP UNIQUE KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 8;

创建同步任务报错: CREATE SYNC ods.test_doris_job6 ( FROM test.test_doris2 INTO test_doris2 COLUMNS(id, name, create_at, update_at) ) FROM BINLOG ( "type" = "canal", "canal.server.ip" = "x.x.x.x", "canal.server.port" = "11111", "canal.destination" = "doris", "canal.username" = "", "canal.password" = "" ); 错误信息: [2021-12-08 17:22:23] [42000][1064] errCode = 2, detailMessage = Syntax error in line 4: [2021-12-08 17:22:23] COLUMNS(id, name, create_at, update_at) [2021-12-08 17:22:23] ^ [2021-12-08 17:22:23] Encountered: COLUMNS [2021-12-08 17:22:23] Expected: COMMA

What You Expected?

我想调换字段顺序映射

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

kuangye098 commented 2 years ago

name is a reserved word. Cause grammatical analysis errors, right?

yhp353134 commented 2 years ago

@kuangye098 不是 语法检查都不过去 我换成其他名称也创建不成功

Mlilion commented 2 years ago

去掉COLUMNS关键字,后面直接跟字段是可以的,但是有个bug,就是配置字段映射后,mysql源表新增字段同步任务就出错了

yhp353134 commented 2 years ago

@Mlilion 不用COLUMNS确实可以创建成功,但是值的位置没有变
image

hi-liuxt commented 2 years ago

@Mlilion 不用COLUMNS确实可以创建成功,但是值的位置没有变 image

请问这个问题后面有解决么?