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_r310105226
 
 

 ##########
 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
 
 Review comment:
   I had a discussion with @wuchong on this problem (see @wuchong 's 2nd 
comment in the last review).
   
   In the 1st edition of this commit, I verified everything from the 
`ExecutionConfigOptions` and `OptimizerConfigOptions` and called the 
corresponding verification method according to their types. But as @wuchong 
mentioned, this will force syncing of these files with `ConfigurationEntry`. As 
the config options will be later verified by planner, we can simply validate 
them as strings here.
   
   I decided to use Java reflection to fetch all options in these two option 
classes and validate them in my 2nd edition of the commit, but I soon discover 
that validating them as strings actually does nothing, so I leave the 
validating method to be empty and let planner verify the options later.
   
   I'll discuss with @wuchong again to find a more proper solution.

----------------------------------------------------------------
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

Reply via email to