This is an automated email from the ASF dual-hosted git repository.

dwysakowicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 02cdfe88d5e686bedb7461e8e0b5f60bf807e095
Author: godfreyhe <[email protected]>
AuthorDate: Sat Jun 13 17:44:10 2020 +0800

    [hotfix] Code cleanup: remove useless parameter from Environment#enrich 
method
---
 .../apache/flink/table/client/config/Environment.java  | 18 +++++++-----------
 .../table/client/gateway/local/LocalExecutor.java      |  2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
index cb72b70..7584552 100644
--- 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
+++ 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/Environment.java
@@ -26,7 +26,6 @@ import 
org.apache.flink.table.client.config.entries.ExecutionEntry;
 import org.apache.flink.table.client.config.entries.FunctionEntry;
 import org.apache.flink.table.client.config.entries.ModuleEntry;
 import org.apache.flink.table.client.config.entries.TableEntry;
-import org.apache.flink.table.client.config.entries.ViewEntry;
 
 import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonMappingException;
 
@@ -267,28 +266,25 @@ public class Environment {
        }
 
        public Environment clone() {
-               return enrich(this, Collections.emptyMap(), 
Collections.emptyMap());
+               return enrich(this, Collections.emptyMap());
        }
 
        /**
-        * Enriches an environment with new/modified properties or views and 
returns the new instance.
+        * Enriches an environment with new/modified properties and returns the 
new instance.
         */
-       public static Environment enrich(
-                       Environment env,
-                       Map<String, String> properties,
-                       Map<String, ViewEntry> views) {
+       public static Environment enrich(Environment env, Map<String, String> 
properties) {
                final Environment enrichedEnv = new Environment();
 
+               // copy modules
                enrichedEnv.modules = new LinkedHashMap<>(env.getModules());
 
-               // merge catalogs
+               // copy catalogs
                enrichedEnv.catalogs = new LinkedHashMap<>(env.getCatalogs());
 
-               // merge tables
+               // copy tables
                enrichedEnv.tables = new LinkedHashMap<>(env.getTables());
-               enrichedEnv.tables.putAll(views);
 
-               // merge functions
+               // copy functions
                enrichedEnv.functions = new HashMap<>(env.getFunctions());
 
                // enrich execution properties
diff --git 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
index f778522..dbed581 100644
--- 
a/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
+++ 
b/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
@@ -286,7 +286,7 @@ public class LocalExecutor implements Executor {
                Environment env = context.getEnvironment();
                Environment newEnv;
                try {
-                       newEnv = Environment.enrich(env, 
Collections.singletonMap(key, value), Collections.emptyMap());
+                       newEnv = Environment.enrich(env, 
Collections.singletonMap(key, value));
                } catch (Throwable t) {
                        throw new SqlExecutionException("Could not set session 
property.", t);
                }

Reply via email to