wuchong 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_r309992048
########## File path: flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/entries/ConfigurationEntry.java ########## @@ -0,0 +1,190 @@ +/* + * 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)); + + protected ConfigurationEntry(DescriptorProperties properties) { + super(properties); + } + + @Override + protected void validate(DescriptorProperties properties) { + + // Source options + properties.validateDuration( + ExecutionConfigOptions.TABLE_EXEC_SOURCE_IDLE_TIMEOUT.key(), Review comment: Could we simply verify it is a valid key, and skip to validate type and value? I think it is checked by the planner. If we only check the keys, we can avoid sync configs between this file and `ExecutionConfigOptions` and `OptimizerConfigOptions`. We can use Java reflection to extract options. ---------------------------------------------------------------- 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