chl-wxp commented on code in PR #10241:
URL: https://github.com/apache/seatunnel/pull/10241#discussion_r2646404336
##########
docs/en/connector-v2/sink/Mysql.md:
##########
@@ -209,6 +210,93 @@ sink {
}
```
+### Multiple Table Sync
+
+#### Example 1: MySQL CDC Multiple Table Sync
+
+> Sync multiple tables from MySQL CDC to target MySQL database, using
placeholders for dynamic table name mapping
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
Review Comment:
Delete blank lines
##########
docs/zh/connector-v2/sink/Mysql.md:
##########
@@ -210,6 +210,93 @@ sink {
}
```
+### 多表同步
+
+#### 示例1:MySQL CDC 多表同步
+
+> 通过 MySQL CDC 同步多张表到目标 MySQL 数据库,使用占位符实现动态表名映射
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
+ database = "${database_name}_test"
+ table = "${table_name}_test"
+ primary_keys = ["${primary_key}"]
+ }
+}
+```
+
+#### 示例2:JDBC Source 多表同步到 MySQL
+
+> 从 MySQL 使用 JDBC Source 批量同步多张表到另一个 MySQL 数据库
+
+```
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ Jdbc {
+ driver = com.mysql.cj.jdbc.Driver
+ url = "jdbc:mysql://localhost:3306/source_db"
+ username = "root"
+ password = "123456"
+
Review Comment:
ditto
##########
docs/en/connector-v2/sink/Mysql.md:
##########
@@ -209,6 +210,93 @@ sink {
}
```
+### Multiple Table Sync
+
+#### Example 1: MySQL CDC Multiple Table Sync
+
+> Sync multiple tables from MySQL CDC to target MySQL database, using
placeholders for dynamic table name mapping
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
+ database = "${database_name}_test"
+ table = "${table_name}_test"
+ primary_keys = ["${primary_key}"]
+ }
+}
+```
+
+#### Example 2: JDBC Source Multiple Table Sync to MySQL
+
+> Batch sync multiple tables from MySQL using JDBC Source to another MySQL
database
+
+```
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ Jdbc {
+ driver = com.mysql.cj.jdbc.Driver
+ url = "jdbc:mysql://localhost:3306/source_db"
+ username = "root"
+ password = "123456"
+
Review Comment:
Delete blank lines
##########
docs/en/connector-v2/sink/Mysql.md:
##########
@@ -209,6 +210,93 @@ sink {
}
```
+### Multiple Table Sync
+
+#### Example 1: MySQL CDC Multiple Table Sync
+
+> Sync multiple tables from MySQL CDC to target MySQL database, using
placeholders for dynamic table name mapping
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
+ database = "${database_name}_test"
+ table = "${table_name}_test"
+ primary_keys = ["${primary_key}"]
+ }
+}
+```
+
+#### Example 2: JDBC Source Multiple Table Sync to MySQL
+
+> Batch sync multiple tables from MySQL using JDBC Source to another MySQL
database
+
+```
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ Jdbc {
+ driver = com.mysql.cj.jdbc.Driver
+ url = "jdbc:mysql://localhost:3306/source_db"
+ username = "root"
+ password = "123456"
+
+ table_list = [
+ {
+ table_path = "source_db.table_1"
+ },
+ {
+ table_path = "source_db.table_2"
+ }
+ ]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
Review Comment:
Delete blank lines
##########
docs/zh/connector-v2/sink/Mysql.md:
##########
@@ -210,6 +210,93 @@ sink {
}
```
+### 多表同步
+
+#### 示例1:MySQL CDC 多表同步
+
+> 通过 MySQL CDC 同步多张表到目标 MySQL 数据库,使用占位符实现动态表名映射
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
+ database = "${database_name}_test"
+ table = "${table_name}_test"
+ primary_keys = ["${primary_key}"]
+ }
+}
+```
+
+#### 示例2:JDBC Source 多表同步到 MySQL
+
+> 从 MySQL 使用 JDBC Source 批量同步多张表到另一个 MySQL 数据库
+
+```
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ Jdbc {
+ driver = com.mysql.cj.jdbc.Driver
+ url = "jdbc:mysql://localhost:3306/source_db"
+ username = "root"
+ password = "123456"
+
+ table_list = [
+ {
+ table_path = "source_db.table_1"
+ },
+ {
+ table_path = "source_db.table_2"
+ }
+ ]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
Review Comment:
ditto
##########
docs/zh/connector-v2/sink/Mysql.md:
##########
@@ -210,6 +210,93 @@ sink {
}
```
+### 多表同步
+
+#### 示例1:MySQL CDC 多表同步
+
+> 通过 MySQL CDC 同步多张表到目标 MySQL 数据库,使用占位符实现动态表名映射
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
Review Comment:
ditto
##########
docs/zh/connector-v2/sink/Mysql.md:
##########
@@ -210,6 +210,93 @@ sink {
}
```
+### 多表同步
+
+#### 示例1:MySQL CDC 多表同步
+
+> 通过 MySQL CDC 同步多张表到目标 MySQL 数据库,使用占位符实现动态表名映射
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
Review Comment:
ditto
##########
docs/en/connector-v2/sink/Mysql.md:
##########
@@ -209,6 +210,93 @@ sink {
}
```
+### Multiple Table Sync
+
+#### Example 1: MySQL CDC Multiple Table Sync
+
+> Sync multiple tables from MySQL CDC to target MySQL database, using
placeholders for dynamic table name mapping
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
+source {
+ Mysql-CDC {
+ url = "jdbc:mysql://127.0.0.1:3306/seatunnel"
+ username = "root"
+ password = "******"
+
+ table-names = ["seatunnel.role","seatunnel.user","galileo.Bucket"]
+ }
+}
+
+transform {
+}
+
+sink {
+ Mysql {
+ url =
"jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
+ driver = "com.mysql.cj.jdbc.Driver"
+ username = "root"
+ password = "123456"
+ generate_sink_sql = true
+
Review Comment:
Delete blank lines
##########
docs/en/connector-v2/sink/Mysql.md:
##########
@@ -209,6 +210,93 @@ sink {
}
```
+### Multiple Table Sync
+
+#### Example 1: MySQL CDC Multiple Table Sync
+
+> Sync multiple tables from MySQL CDC to target MySQL database, using
placeholders for dynamic table name mapping
+
+```
+env {
+ parallelism = 1
+ job.mode = "STREAMING"
+ checkpoint.interval = 5000
+}
+
Review Comment:
Delete blank lines
--
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]