TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI URL: https://github.com/apache/flink/pull/9328#discussion_r310164599
########## File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/ConfigurationEntry.java ########## @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.client.config.entries; + +import org.apache.flink.table.api.config.ExecutionConfigOptions; +import org.apache.flink.table.api.config.OptimizerConfigOptions; +import org.apache.flink.table.client.config.ConfigUtil; +import org.apache.flink.table.descriptors.DescriptorProperties; + +import java.util.HashMap; +import java.util.Map; + +import static org.apache.flink.table.client.config.Environment.CONFIGURATION_ENTRIES; + +/** + * Configuration of a table environment. + * The options are the same with {@link ExecutionConfigOptions} and {@link OptimizerConfigOptions}. + */ +public class ConfigurationEntry extends ConfigEntry { + + public static final ConfigurationEntry DEFAULT_INSTANCE = + new ConfigurationEntry(new DescriptorProperties(true)); + + private ConfigurationEntry(DescriptorProperties properties) { + super(properties); + } + + @Override + protected void validate(DescriptorProperties properties) { + // Nothing to validate as the planner will check the options + } + + // -------------------------------------------------------------------------------------------- + + public static ConfigurationEntry create(Map<String, Object> config) { + return new ConfigurationEntry(ConfigUtil.normalizeYaml(config)); + } + + /** + * Merges two execution entries. The properties of the first execution entry might be Review comment: ![got-it](https://github.com/TsReaper/stickers/blob/master/stickers/eastern-timber-wolf/got-it.jpg?raw=true) ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services