Hisoka-X commented on code in PR #6003:
URL: https://github.com/apache/seatunnel/pull/6003#discussion_r1432372339
##########
seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/utils/EnvironmentUtil.java:
##########
@@ -119,15 +119,47 @@ public static void initConfiguration(Config config,
Configuration configuration)
}
}
String prefixConf = "flink.";
+ String filterPrefixConf = "flink.table.exec";
if (!config.isEmpty()) {
for (Map.Entry<String, ConfigValue> entryConfKey :
config.entrySet()) {
String confKey = entryConfKey.getKey().trim();
+ // filters out the parameters prefixed with 'flink.table.exec'
+ if (confKey.startsWith(prefixConf) &&
!confKey.startsWith(filterPrefixConf)) {
+ configuration.setString(
+ confKey.replaceFirst(prefixConf, ""),
+ entryConfKey.getValue().unwrapped().toString());
+ }
+ }
+ }
+ }
+ public static void initTableEnvironmentConfiguration(
+ Config config, Configuration configuration) {
+ /**
+ * flink table configuration items are prefixed with 'table.exec'.
reference: {@link
+ * org.apache.flink.table.api.config.ExecutionConfigOptions}
+ */
+ String prefixConf = "flink.table.exec";
+ String replacePrefix = "flink.";
+ if (!config.isEmpty()) {
+ for (Map.Entry<String, ConfigValue> entryConfKey :
config.entrySet()) {
+ String confKey = entryConfKey.getKey().trim();
if (confKey.startsWith(prefixConf)) {
configuration.setString(
- confKey.replaceFirst(prefixConf, ""),
entryConfKey.getValue().render());
+ confKey.replaceFirst(replacePrefix, ""),
+ entryConfKey.getValue().unwrapped().toString());
}
}
}
Review Comment:
please add test case for this. Look like it remove prefix of
`flink.table.exec.config` to `table.exec.config`. Not worked on
`flink.pipeline.max-parallelism` according doc
https://github.com/apache/seatunnel/pull/6003/files#diff-8f9b660879c6a25ff9d0f64619025ea7be9a72cd0152c4b896843424cab6abbcR44
--
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]