[ https://issues.apache.org/jira/browse/FLINK-18095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17170950#comment-17170950 ]
Satyam Shekhar commented on FLINK-18095: ---------------------------------------- For testing purposes, I create a mini-cluster that can outlive a query. I would like to use a TableEnviroment connected to the mini-cluster in tests. The ability to inject a StreamingEnvironment provides the right interface to allow users to easily connect to real Flink cluster in production or in-process mini-cluster in tests. > Custom Execution Environment for TableEnvironment > ------------------------------------------------- > > Key: FLINK-18095 > URL: https://issues.apache.org/jira/browse/FLINK-18095 > Project: Flink > Issue Type: New Feature > Components: Table SQL / API > Affects Versions: 1.10.0 > Reporter: Satyam Shekhar > Priority: Minor > > The recommended pattern for creating a TableEnvironment that uses Blink > planner in batch mode is the following - > > var settings = EnvironmentSettings.newInstance() > .useBlinkPlanner() > .inBatchMode() > .build(); > var tEnv = TableEnvironment.create(settings); > > The above configuration, however, does not allow injecting an > ExecutionEnvironment in TableEnvironment. Instead, TableEnvironment is > hardcoded to always get the ExecutionEnvironment via > StreamExecutionEnvironment.getExecutionEnvironment(). This limits users to > connect to a remote environment while working with TableEnvironment. > > The workaround suggested by [~godfreyhe] and [~jark] is to directly create a > StreamTableEnvironmentImpl instance through StreamTableEnvironmentImpl > constructor instead of create method. -- This message was sent by Atlassian Jira (v8.3.4#803005)