[
https://issues.apache.org/jira/browse/FLINK-39916?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
XiaodongHuan updated FLINK-39916:
---------------------------------
Description:
In MySqlDataSourceFactory, the exception message uses "{}" as a placeholder
inside String.format(...).
Current code:
throw new IllegalArgumentException(
String.format(
"Only \"snapshot\" of MySQLDataSource StartupOption is
supported in BATCH pipeline, but actual MySQLDataSource StartupOption is {}.",
startupOptions.startupMode));
Expected:
The actual startup mode should be included in the exception message.
Suggested fix:
Replace "{}" with "%s":
File:
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/factory/MySqlDataSourceFactory.java
Additional cleanup:
The same file also contains an unused constant:
private static final String DOT_PLACEHOLDER = "_$dot_placeholder$_";
This constant is not referenced anywhere in MySqlDataSourceFactory.java and can
be safely removed as part of the same small cleanup.
was:
In MySqlDataSourceFactory, the exception message uses "{}" as a placeholder
inside String.format(...).
Current code:
throw new IllegalArgumentException(
String.format(
"Only \"snapshot\" of MySQLDataSource StartupOption is
supported in BATCH pipeline, but actual MySQLDataSource StartupOption is {}.",
startupOptions.startupMode));
Expected:
The actual startup mode should be included in the exception message.
Suggested fix:
Replace "{}" with "%s":
File:
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/factory/MySqlDataSourceFactory.java
> Incorrect placeholder used in MySqlDataSourceFactory exception message
> ----------------------------------------------------------------------
>
> Key: FLINK-39916
> URL: https://issues.apache.org/jira/browse/FLINK-39916
> Project: Flink
> Issue Type: Bug
> Components: Flink CDC
> Affects Versions: cdc-3.5.0
> Reporter: XiaodongHuan
> Priority: Minor
> Labels: pull-request-available
>
> In MySqlDataSourceFactory, the exception message uses "{}" as a placeholder
> inside String.format(...).
> Current code:
> throw new IllegalArgumentException(
> String.format(
> "Only \"snapshot\" of MySQLDataSource StartupOption is
> supported in BATCH pipeline, but actual MySQLDataSource StartupOption is {}.",
> startupOptions.startupMode));
> Expected:
> The actual startup mode should be included in the exception message.
> Suggested fix:
> Replace "{}" with "%s":
> File:
> flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/factory/MySqlDataSourceFactory.java
> Additional cleanup:
> The same file also contains an unused constant:
> private static final String DOT_PLACEHOLDER = "_$dot_placeholder$_";
> This constant is not referenced anywhere in MySqlDataSourceFactory.java and
> can be safely removed as part of the same small cleanup.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)