jmbkeyes opened a new issue, #10218:
URL: https://github.com/apache/seatunnel/issues/10218
2张表做同步时,然后每张表都只需要同步指定的列,要怎么做?
配置文件里写2个CDC源,2个transform,然后2个sink?
`source {
MySQL-CDC {
base-url="jdbc:mysql://10.0.0.12:3306/bocai"
username = "root"
password = "Forzadata1234"
database-names=[
"bocai"
]
table-names=[
"bocai.action_type",
]
# 初始化模式(全量+增量)
startup.mode = "initial"
# 启用 ddl 变更
#schema-changes.enabled = true
# 并行读取配置
snapshot.split.size = 8096
snapshot.fetch.size = 1024
plugin_output = "action_type_cdc"
}
MySQL-CDC {
base-url="jdbc:mysql://10.0.0.12:3306/bocai"
username = "root"
password = "Forzadata1234"
database-names=[
"bocai"
]
table-names=[
"bocai.action_details",
]
# 初始化模式(全量+增量)
startup.mode = "initial"
# 启用 ddl 变更
#schema-changes.enabled = true
# 并行读取配置
snapshot.split.size = 8096
snapshot.fetch.size = 1024
plugin_output = "action_details_cdc"
}
}
transform {
Sql {
plugin_input = "action_type_cdc"
plugin_output = "action_type"
query = "select id, name, centerId from action_type_cdc"
}
Sql {
plugin_input = "action_details_cdc"
plugin_output = "action_details"
query = "select id, name, actionTypeId, desc from
action_details_cdc"
}
}
sink {
Jdbc {
url =
"jdbc:mysql://10.0.0.181:3306/bocai?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
driver = "com.mysql.cj.jdbc.Driver"
user = "root"
password = "Forzadata1234"
database = "bocai"
source_table_name = "action_details"
table = "${table_name}"
schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
generate_sink_sql = true
data_save_mode = "APPEND_DATA"
# enable_upsert = false
# support_upsert_by_query_primary_key_exist = true
# 精确一次语义(可选)
#is_exactly_once = true
#xa_data_source_class_name = "com.mysql.cj.jdbc.MysqlXADataSource"
}
Jdbc {
url =
"jdbc:mysql://10.0.0.181:3306/bocai?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true"
driver = "com.mysql.cj.jdbc.Driver"
user = "root"
password = "Forzadata1234"
database = "bocai"
source_table_name = "action_type"
table = "${table_name}"
schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
generate_sink_sql = true
data_save_mode = "APPEND_DATA"
# enable_upsert = false
# support_upsert_by_query_primary_key_exist = true
# 精确一次语义(可选)
#is_exactly_once = true
#xa_data_source_class_name = "com.mysql.cj.jdbc.MysqlXADataSource"
}
}`
--
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]