matriv commented on a change in pull request #18895:
URL: https://github.com/apache/flink/pull/18895#discussion_r812682310
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java
##########
@@ -81,6 +84,43 @@
/** A configuration object to hold all key/value configuration. */
private final Configuration configuration = new Configuration();
+ /**
+ * Sets a value for the given {@link ConfigOption}.
+ *
+ * <p>This method should be preferred over {@link #set(String, String)} as
it is type-safe,
+ * avoids unnecessary parsing of the value, and provides inline
documentation.
+ *
+ * <p>Note: Scala users might need to convert the value into a boxed type.
E.g. by using {@code
+ * Int.box(1)} or {@code Boolean.box(false)}.
+ *
+ * @see TableConfigOptions
+ * @see ExecutionConfigOptions
+ * @see OptimizerConfigOptions
+ */
+ @Override
+ public <T> TableConfig set(ConfigOption<T> option, T value) {
+ configuration.set(option, value);
+ return this;
+ }
+
+ /**
+ * Sets a string-based value for the given string-based key.
+ *
+ * <p>The value will be parsed by the framework on access.
+ *
+ * <p>This method exists for convenience when configuring a session with
string-based
+ * properties. Use {@link #set(ConfigOption, Object)} for more type-safety
and inline
+ * documentation.
+ *
+ * @see TableConfigOptions
+ * @see ExecutionConfigOptions
+ * @see OptimizerConfigOptions
+ */
+ public TableConfig set(String key, String value) {
Review comment:
Is there no way to avoid this and force the usage of the type safe
`set()`?
--
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]