chyueyi commented on issue #6723: URL: https://github.com/apache/inlong/issues/6723#issuecomment-1342523530
> 这里是flink任务运行需要的Flink SQL。多表和整库同步的逻辑可以只关注多表部分,忽略单表的部分,可能会更容易理解。 多表的核心是: 1.mysql按正则读多表 'database-name' = 'user_db', 'table-name' = 'user_id_*' (这部分文档中写的确实有问题) 2.doris写设置如下参数: 'sink.multiple.enable' 'sink.multiple.format' 'sink.multiple.database-pattern' 'sink.multiple.table-pattern' 请问多表同步的时候mysql cdc source 和 doris sink表字段映射怎么写,官方文档如下: ```shell ./bin/sql-client.sh -l ./opt/connectors/mysql-cdc-inlong/ -l ./opt/connectors/doris/ Flink SQL> SET 'execution.checkpointing.interval' = '3s'; [INFO] Session property has been set. Flink SQL> SET 'table.dynamic-table-options.enabled' = 'true'; [INFO] Session property has been set. Flink SQL> CREATE TABLE cdc_mysql_source ( > id int > ,name VARCHAR > ,dr TINYINT > ,PRIMARY KEY (id) NOT ENFORCED > ) WITH ( > 'connector' = 'mysql-cdc-inlong', > 'hostname' = 'localhost', > 'port' = '3306', > 'username' = 'root', > 'password' = '123456', > 'database-name' = 'test', > 'table-name' = 'cdc_mysql_source' > ); [INFO] Execute statement succeed. Flink SQL> CREATE TABLE cdc_doris_sink ( > id INT, > name STRING, > dr TINYINT > ) WITH ( > 'connector' = 'doris-inlong', > 'fenodes' = 'localhost:8030', > 'username' = 'root', > 'password' = '000000', > 'sink.enable-delete' = 'true', > 'sink.multiple.enable' = 'true', > 'sink.multiple.format' = 'canal-json', > 'sink.multiple.database-pattern' = '${database}', > 'sink.multiple.table-pattern' = 'doris_${table}' > ); [INFO] Execute statement succeed. -- 支持删除事件同步(sink.enable-delete='true'), 需要 Doris 表开启批量删除功能 Flink SQL> insert into cdc_doris_sink select * from cdc_mysql_source /*+ OPTIONS('server-id'='5402') */; [INFO] Submitting SQL update statement to the cluster... [INFO] SQL update statement has been successfully submitted to the cluster: Job ID: 30feaa0ede92h6b6e25ea0cfda26df5e ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org