[ 
https://issues.apache.org/jira/browse/FLINK-15539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17012402#comment-17012402
 ] 

Rui Li commented on FLINK-15539:
--------------------------------

Hi [~dwysakowicz], actually it's not easy to instantiate new table env in scala 
shell. For example, I tried the following and hit some issues:
{noformat}
scala> import org.apache.flink.table.api.EnvironmentSettings
import org.apache.flink.table.api.EnvironmentSettings

scala> val settings = 
EnvironmentSettings.newInstance().useBlinkPlanner().inBatchMode().build()
settings: org.apache.flink.table.api.EnvironmentSettings = 
org.apache.flink.table.api.EnvironmentSettings@5eae392d

scala> import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.api.TableEnvironment

scala> val tableEnv = TableEnvironment.create(settings)
<console>:70: error: Static methods in interface require -target:jvm-1.8
       val tableEnv = TableEnvironment.create(settings)
                                             ^

scala> import org.apache.flink.table.api.internal.TableEnvironmentImpl
import org.apache.flink.table.api.internal.TableEnvironmentImpl

scala> val tableEnv = TableEnvironmentImpl.create(settings)
java.lang.UnsupportedOperationException: Execution Environment is already 
defined for this shell.
  at 
org.apache.flink.api.java.ScalaShellStreamEnvironment.lambda$disableAllContextAndOtherEnvironments$0(ScalaShellStreamEnvironment.java:96)
  at java.util.Optional.map(Optional.java:215)
  at 
org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.getExecutionEnvironment(StreamExecutionEnvironment.java:1875)
  at 
org.apache.flink.table.planner.delegation.BlinkExecutorFactory.create(BlinkExecutorFactory.java:61)
  at 
org.apache.flink.table.api.internal.TableEnvironmentImpl.create(TableEnvironmentImpl.java:204)
  ... 30 elided
{noformat}

I managed to create a table env with blink planner & streaming mode like 
[this|https://issues.apache.org/jira/browse/FLINK-15511?focusedCommentId=17010518&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17010518].
 But I still don't know how to create table env with blink planner & batch mode.

> Allow user to choose planner for scala shell
> --------------------------------------------
>
>                 Key: FLINK-15539
>                 URL: https://issues.apache.org/jira/browse/FLINK-15539
>             Project: Flink
>          Issue Type: Improvement
>          Components: Scala Shell
>            Reporter: Rui Li
>            Priority: Major
>
> It seems scala shell always uses old planner to create the table 
> environments. It's better if this can be configurable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to