chyueyi opened a new pull request, #7079: URL: https://github.com/apache/inlong/pull/7079
## Prepare a Pull Request - [[INLONG-7076] [sort-connector-jdbc] Add multi table sink for MySQL](https://github.com/apache/inlong/issues/7076) - Fixes #XYZ ### Motivation - Users want to real time sync multi-tables data in mongoDB、KAFKA etc to MySql or other JDBC based databases in many case. We need multi table-sink connector for MySql. - Based on flink-connector-jdbc, sort-connector-jdbc can sink data to MySql in two formats: canal-json. ### Modifications - Add multi table sink for MySQL - add MySQLRowConverter, MySQLDialect - modify JdbcMultiBatchingOutputFormat and AbstractJdbcRowConverter to Support Mysql data type ### Verifying this change *(Please pick either of the following options)* - [ ] This change is a trivial rework/code cleanup without any test coverage. - [ ] This change is already covered by existing tests, such as: *(please describe tests)* - [ ] This change added tests and can be verified as follows: *(example:)* ```sql CREATE TABLE cdc_mysql_source ( `data` BYTES METADATA FROM 'meta.data_canal' VIRTUAL ) WITH ( 'inlong.metric.labels' = 'groupId=1&streamId=1&nodeId=1', 'migrate-all' = 'true', 'connector' = 'mysql-cdc-inlong', 'scan.incremental.snapshot.enabled' = 'false', 'hostname' = 'localhost', 'database-name' = 'test', 'server-time-zone' = 'Asia/Shanghai', 'username' = '****', 'password' = '****', 'table-name' = 'test\.[\s\S]*' ); CREATE TABLE cdc_mysql_sink ( `data` BYTES )WITH ( 'connector' = 'jdbc-inlong', 'url' = 'jdbc:mysql://localhost:3306', 'username' = '****', 'password' = '****', 'table-name' = 'test', 'sink.multiple.enable' = 'true', 'sink.multiple.schema-update.policy' = 'TRY_IT_BEST', 'sink.multiple.format' = 'canal-json', 'sink.multiple.database-pattern' = 'test2', 'sink.multiple.schema-pattern' = '', 'sink.multiple.table-pattern' = '${table}' ); insert into cdc_mysql_sink select * from cdc_mysql_source; ``` ### Documentation - Does this pull request introduce a new feature? (yes / no) - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) - If a feature is not applicable for documentation, explain why? - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
