[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013145
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,154 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
+  - name: TableNumber1
+type: source-table
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField1
+type: INT
+  - name: StringField1
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH1"
+format:
+  type: csv
+  fields:
+- name: IntegerField1
+  type: INT
+- name: StringField1
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TestView1
+type: view
+query: SELECT scalarUDF(IntegerField1) FROM TableNumber1
+  - name: TableNumber2
+# Test backwards compatibility ("source" -> "source-table")
+type: source
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField2
+type: INT
+  - name: StringField2
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH2"
+format:
+  type: csv
+  fields:
+- name: IntegerField2
+  type: INT
+- name: StringField2
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TableSourceSink
+type: source-sink-table
+$VAR_UPDATE_MODE
+schema:
+  - name: BooleanField
+type: BOOLEAN
+  - name: StringField
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_SINK_PATH"
+format:
+  type: csv
+  fields:
+- name: BooleanField
+  type: BOOLEAN
+- name: StringField
+  type: VARCHAR
+  - name: TestView2
+type: view
+query: SELECT * FROM TestView1
+
+functions:
+  - name: scalarUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$ScalarUDF
+constructor:
+  - 5
+  - name: aggregateUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$AggregateUDF
+constructor:
+  - StarryName
+  - false
+  - class: java.lang.Integer
+constructor:
+  - class: java.lang.String
+constructor:
+  - type: VARCHAR
+value: 3
+  - name: tableUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$TableUDF
+constructor:
+  - type: LONG
+value: 5
+
+catalogs:
+  - name: catalog1
+type: DependencyTest
+  - name: simple-catalog
+type: simple-catalog
+test-table: test-table
+
+execution:
+  planner: "$VAR_PLANNER"
+  type: "$VAR_EXECUTION_TYPE"
+  time-characteristic: event-time
+  periodic-watermarks-interval: 99
+  parallelism: 1
+  max-parallelism: 16
+  min-idle-state-retention: 0
+  max-idle-state-retention: 0
+  result-mode: "$VAR_RESULT_MODE"
+  max-table-result-rows: "$VAR_MAX_ROWS"
+  restart-strategy:
+type: failure-rate
+max-failures-per-interval: 10
+failure-rate-interval: 99000
+delay: 1000
+
+deployment:
+  response-timeout: 5000
+
+configuration:
+  table:
+exec:
+  sort:
+default-limit: "$SORT_DEFAULT_LIMIT"
+  spill-compression:
+enabled: true
+block-size: 128kb
+optimizer:
+  join-reorder-enabled: true
 
 Review comment:
   
![got-it](https://github.com/TsReaper/stickers/blob/master/stickers/eastern-timber-wolf/got-it.jpg?raw=true)


This is an automa

[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013172
 
 

 ##
 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:
   
![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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310163237
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
 ##
 @@ -212,6 +226,9 @@ public static Environment merge(Environment env1, 
Environment env2) {
// merge deployment properties
mergedEnv.deployment = 
DeploymentEntry.merge(env1.getDeployment(), env2.getDeployment());
 
+   // merge execution properties
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310164437
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
 ##
 @@ -50,6 +51,9 @@
 
public static final String DEPLOYMENT_ENTRY = "deployment";
 
+   public static final String[] CONFIGURATION_ENTRIES = new String[]{
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310164347
 
 

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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310168533
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
 ##
 @@ -505,6 +506,45 @@ public void testUseCatalogAndUseDatabase() throws 
Exception {
}
}
 
+   @Test(timeout = 30_000L)
+   public void testTableEnvConfigurations() throws Exception {
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310169355
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,149 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310169392
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,149 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310169392
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,149 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310169355
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,149 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310168533
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
 ##
 @@ -505,6 +506,45 @@ public void testUseCatalogAndUseDatabase() throws 
Exception {
}
}
 
+   @Test(timeout = 30_000L)
+   public void testTableEnvConfigurations() throws Exception {
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310164347
 
 

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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310164437
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
 ##
 @@ -50,6 +51,9 @@
 
public static final String DEPLOYMENT_ENTRY = "deployment";
 
+   public static final String[] CONFIGURATION_ENTRIES = new String[]{
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310163237
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
 ##
 @@ -212,6 +226,9 @@ public static Environment merge(Environment env1, 
Environment env2) {
// merge deployment properties
mergedEnv.deployment = 
DeploymentEntry.merge(env1.getDeployment(), env2.getDeployment());
 
+   // merge execution properties
 
 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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013172
 
 

 ##
 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:
   
![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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013172
 
 

 ##
 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:
   
![got-it](![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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013145
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,154 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
+  - name: TableNumber1
+type: source-table
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField1
+type: INT
+  - name: StringField1
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH1"
+format:
+  type: csv
+  fields:
+- name: IntegerField1
+  type: INT
+- name: StringField1
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TestView1
+type: view
+query: SELECT scalarUDF(IntegerField1) FROM TableNumber1
+  - name: TableNumber2
+# Test backwards compatibility ("source" -> "source-table")
+type: source
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField2
+type: INT
+  - name: StringField2
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH2"
+format:
+  type: csv
+  fields:
+- name: IntegerField2
+  type: INT
+- name: StringField2
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TableSourceSink
+type: source-sink-table
+$VAR_UPDATE_MODE
+schema:
+  - name: BooleanField
+type: BOOLEAN
+  - name: StringField
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_SINK_PATH"
+format:
+  type: csv
+  fields:
+- name: BooleanField
+  type: BOOLEAN
+- name: StringField
+  type: VARCHAR
+  - name: TestView2
+type: view
+query: SELECT * FROM TestView1
+
+functions:
+  - name: scalarUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$ScalarUDF
+constructor:
+  - 5
+  - name: aggregateUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$AggregateUDF
+constructor:
+  - StarryName
+  - false
+  - class: java.lang.Integer
+constructor:
+  - class: java.lang.String
+constructor:
+  - type: VARCHAR
+value: 3
+  - name: tableUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$TableUDF
+constructor:
+  - type: LONG
+value: 5
+
+catalogs:
+  - name: catalog1
+type: DependencyTest
+  - name: simple-catalog
+type: simple-catalog
+test-table: test-table
+
+execution:
+  planner: "$VAR_PLANNER"
+  type: "$VAR_EXECUTION_TYPE"
+  time-characteristic: event-time
+  periodic-watermarks-interval: 99
+  parallelism: 1
+  max-parallelism: 16
+  min-idle-state-retention: 0
+  max-idle-state-retention: 0
+  result-mode: "$VAR_RESULT_MODE"
+  max-table-result-rows: "$VAR_MAX_ROWS"
+  restart-strategy:
+type: failure-rate
+max-failures-per-interval: 10
+failure-rate-interval: 99000
+delay: 1000
+
+deployment:
+  response-timeout: 5000
+
+configuration:
+  table:
+exec:
+  sort:
+default-limit: "$SORT_DEFAULT_LIMIT"
+  spill-compression:
+enabled: true
+block-size: 128kb
+optimizer:
+  join-reorder-enabled: true
 
 Review comment:
   
![got-it](https://github.com/TsReaper/stickers/blob/master/stickers/eastern-timber-wolf/got-it.jpg?raw=true)


This is an automa

[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013172
 
 

 ##
 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:
   
![ok](https://github.com/TsReaper/stickers/blob/master/stickers/eastern-timber-wolf/ok.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


[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013145
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,154 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
+  - name: TableNumber1
+type: source-table
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField1
+type: INT
+  - name: StringField1
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH1"
+format:
+  type: csv
+  fields:
+- name: IntegerField1
+  type: INT
+- name: StringField1
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TestView1
+type: view
+query: SELECT scalarUDF(IntegerField1) FROM TableNumber1
+  - name: TableNumber2
+# Test backwards compatibility ("source" -> "source-table")
+type: source
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField2
+type: INT
+  - name: StringField2
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH2"
+format:
+  type: csv
+  fields:
+- name: IntegerField2
+  type: INT
+- name: StringField2
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TableSourceSink
+type: source-sink-table
+$VAR_UPDATE_MODE
+schema:
+  - name: BooleanField
+type: BOOLEAN
+  - name: StringField
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_SINK_PATH"
+format:
+  type: csv
+  fields:
+- name: BooleanField
+  type: BOOLEAN
+- name: StringField
+  type: VARCHAR
+  - name: TestView2
+type: view
+query: SELECT * FROM TestView1
+
+functions:
+  - name: scalarUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$ScalarUDF
+constructor:
+  - 5
+  - name: aggregateUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$AggregateUDF
+constructor:
+  - StarryName
+  - false
+  - class: java.lang.Integer
+constructor:
+  - class: java.lang.String
+constructor:
+  - type: VARCHAR
+value: 3
+  - name: tableUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$TableUDF
+constructor:
+  - type: LONG
+value: 5
+
+catalogs:
+  - name: catalog1
+type: DependencyTest
+  - name: simple-catalog
+type: simple-catalog
+test-table: test-table
+
+execution:
+  planner: "$VAR_PLANNER"
+  type: "$VAR_EXECUTION_TYPE"
+  time-characteristic: event-time
+  periodic-watermarks-interval: 99
+  parallelism: 1
+  max-parallelism: 16
+  min-idle-state-retention: 0
+  max-idle-state-retention: 0
+  result-mode: "$VAR_RESULT_MODE"
+  max-table-result-rows: "$VAR_MAX_ROWS"
+  restart-strategy:
+type: failure-rate
+max-failures-per-interval: 10
+failure-rate-interval: 99000
+delay: 1000
+
+deployment:
+  response-timeout: 5000
+
+configuration:
+  table:
+exec:
+  sort:
+default-limit: "$SORT_DEFAULT_LIMIT"
+  spill-compression:
+enabled: true
+block-size: 128kb
+optimizer:
+  join-reorder-enabled: true
 
 Review comment:
   
![ok](https://github.com/TsReaper/stickers/blob/master/stickers/eastern-timber-wolf/ok.jpg?raw=true)


This is an automated mess

[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013145
 
 

 ##
 File path: 
flink-table/flink-sql-client/src/test/resources/test-sql-client-configurations.yaml
 ##
 @@ -0,0 +1,154 @@
+
+#  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.
+
+
+#==
+# TEST ENVIRONMENT FILE
+# General purpose default environment file.
+#==
+
+# this file has variables that can be filled with content by replacing $VAR_XXX
+
+tables:
+  - name: TableNumber1
+type: source-table
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField1
+type: INT
+  - name: StringField1
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH1"
+format:
+  type: csv
+  fields:
+- name: IntegerField1
+  type: INT
+- name: StringField1
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TestView1
+type: view
+query: SELECT scalarUDF(IntegerField1) FROM TableNumber1
+  - name: TableNumber2
+# Test backwards compatibility ("source" -> "source-table")
+type: source
+$VAR_UPDATE_MODE
+schema:
+  - name: IntegerField2
+type: INT
+  - name: StringField2
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_PATH2"
+format:
+  type: csv
+  fields:
+- name: IntegerField2
+  type: INT
+- name: StringField2
+  type: VARCHAR
+  line-delimiter: "\n"
+  comment-prefix: "#"
+  - name: TableSourceSink
+type: source-sink-table
+$VAR_UPDATE_MODE
+schema:
+  - name: BooleanField
+type: BOOLEAN
+  - name: StringField
+type: VARCHAR
+connector:
+  type: filesystem
+  path: "$VAR_SOURCE_SINK_PATH"
+format:
+  type: csv
+  fields:
+- name: BooleanField
+  type: BOOLEAN
+- name: StringField
+  type: VARCHAR
+  - name: TestView2
+type: view
+query: SELECT * FROM TestView1
+
+functions:
+  - name: scalarUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$ScalarUDF
+constructor:
+  - 5
+  - name: aggregateUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$AggregateUDF
+constructor:
+  - StarryName
+  - false
+  - class: java.lang.Integer
+constructor:
+  - class: java.lang.String
+constructor:
+  - type: VARCHAR
+value: 3
+  - name: tableUDF
+from: class
+class: 
org.apache.flink.table.client.gateway.utils.UserDefinedFunctions$TableUDF
+constructor:
+  - type: LONG
+value: 5
+
+catalogs:
+  - name: catalog1
+type: DependencyTest
+  - name: simple-catalog
+type: simple-catalog
+test-table: test-table
+
+execution:
+  planner: "$VAR_PLANNER"
+  type: "$VAR_EXECUTION_TYPE"
+  time-characteristic: event-time
+  periodic-watermarks-interval: 99
+  parallelism: 1
+  max-parallelism: 16
+  min-idle-state-retention: 0
+  max-idle-state-retention: 0
+  result-mode: "$VAR_RESULT_MODE"
+  max-table-result-rows: "$VAR_MAX_ROWS"
+  restart-strategy:
+type: failure-rate
+max-failures-per-interval: 10
+failure-rate-interval: 99000
+delay: 1000
+
+deployment:
+  response-timeout: 5000
+
+configuration:
+  table:
+exec:
+  sort:
+default-limit: "$SORT_DEFAULT_LIMIT"
+  spill-compression:
+enabled: true
+block-size: 128kb
+optimizer:
+  join-reorder-enabled: true
 
 Review comment:
   
![ok](https://github.com/TsReaper/stickers/blob/master/stickers/ok-eastern-timber-wolf.jpg?raw=true)


This is an automated mess

[GitHub] [flink] TsReaper commented on a change in pull request #9328: [FLINK-13521][sql-client] Allow setting configurations in SQL CLI

2019-08-02 Thread GitBox
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_r310013172
 
 

 ##
 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:
   
![ok](https://github.com/TsReaper/stickers/blob/master/stickers/ok-eastern-timber-wolf.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