yuxiqian commented on code in PR #4246:
URL: https://github.com/apache/flink-cdc/pull/4246#discussion_r2958172129
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-mysql-cdc/src/main/java/org/apache/flink/cdc/connectors/mysql/source/config/MySqlSourceConfigFactory.java:
##########
@@ -397,8 +413,26 @@ public MySqlSourceConfig createConfig(int subtaskId,
String serverName) {
if (databaseList != null) {
props.setProperty("database.include.list", String.join(",",
databaseList));
}
+ // Validate: Two modes are mutually exclusive
+ if (scanBinlogNewlyAddedTableEnabled && scanNewlyAddedTableEnabled) {
+ throw new IllegalArgumentException(
+ "Cannot enable both
'scan.binlog.newly-added-table.enabled' and "
+ + "'scan.newly-added-table.enabled' as they may
cause duplicate data");
+ }
+
if (tableList != null) {
- props.setProperty("table.include.list", String.join(",",
tableList));
+ // Convert table patterns to Debezium style if binlog auto-capture
is enabled
+ if (scanBinlogNewlyAddedTableEnabled) {
+ String originalPattern = String.join(",", tableList);
+ String debeziumPattern =
convertToDebeziumStyle(originalPattern);
+ props.setProperty("table.include.list", debeziumPattern);
Review Comment:
IIUC MySQL DataStream connector uses standard RegEx (`.` is wildcard matcher
and `\.` is the dot character). But after your modification and binlog newly
tables capturing enabled, `.` will be the dot character and db/table delimiter
while `\.` is the meta character, which is strange. Keeping the same behavior
in binlog capturing mode unchanged would make more sense.
--
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]