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

Zheng Hu commented on FLINK-14672:
----------------------------------

Now we only have the embedded mode SQL to interact with Flink cluster, in 
future it will support the gateway mode, which means it will maitain 
multi-sessions at the server side. Will be necessary to make it to
be stateful for the Executor (both LocalExecutor and GatewayExecutor). We've 
discussed session management before and the core idea is:  Provide two extra 
API in Executor interface: 
1. String openSession(SessionContext context);  it will create a new session 
based on the passed session context, the session will have the 
ExecutionContext/TableEnviroment/UDF informations (etc).  and the openSession
will return a uuid string which represent the session identify, the following 
operations of this session will attach the sessionId to request the Executor 
(both local and gateway). 
2. String closeSession(String sessionId);   it will close the session(clear the 
session related resources) with given session identify.

> Make Executor stateful in sql client
> ------------------------------------
>
>                 Key: FLINK-14672
>                 URL: https://issues.apache.org/jira/browse/FLINK-14672
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Client
>            Reporter: Kurt Young
>            Assignee: Zheng Hu
>            Priority: Major
>
> Currently sql client is stateless, it read config files into `Environment` 
> and recorded all session changes into `SessionContext`. 
> Each time sql client want to execute a new command, we have to first 
> construct `ExecutionContext` by combining `Environment` and `SessionContext`, 
> and then transfer all information into a new `EnvironmentInstance`. 
> It works well before but kind of hard to extend now. One example is support 
> creating table in sql client. We have to remember create statements and 
> replay them every time we want to execute a new command. 
> If we can make sql client stateful, and table environment be the state of sql 
> client, things will be much more easier. 
> This Jira should revisit all related classes, and define a clean relationship 
> between old roles after making sql client stateful. 
>  



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

Reply via email to