wuchong commented on a change in pull request #16563:
URL: https://github.com/apache/flink/pull/16563#discussion_r676259449



##########
File path: 
flink-table/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
##########
@@ -480,28 +404,44 @@ private ResultDescriptor executeQuery(Executor executor, 
String sessionId, Strin
         return executor.executeQuery(sessionId, (QueryOperation) operation);
     }
 
-    private LocalExecutor createLocalExecutor(Environment environment, 
List<URL> dependencies) {
+    private LocalExecutor createLocalExecutor() {
+        return createLocalExecutor(Collections.emptyList(), new 
Configuration());
+    }
 
+    private LocalExecutor createLocalExecutor(List<URL> dependencies, 
Configuration configuration) {
+        configuration.addAll(clusterClient.getFlinkConfiguration());
         DefaultContext defaultContext =
                 new DefaultContext(
-                        environment,
-                        dependencies,
-                        clusterClient.getFlinkConfiguration(),
-                        Collections.singletonList(new DefaultCLI()));
+                        dependencies, configuration, 
Collections.singletonList(new DefaultCLI()));
         return new LocalExecutor(defaultContext);
     }
 
+    private void initSession(Executor executor, String sessionId, Map<String, 
String> replaceVars) {
+        for (String sql : getInitSQL(replaceVars)) {
+            sql = sql.trim();
+            if (sql.endsWith(";")) {
+                sql = sql.substring(0, sql.trim().length() - 1).trim();
+            }
+            executor.executeOperation(sessionId, 
executor.parseStatement(sessionId, sql.trim()));

Review comment:
       I think we can remove all the `.trim()` except the first one in the 
method.
   
   




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to