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

Hequn Cheng edited comment on FLINK-11067 at 2/26/19 12:08 PM:
---------------------------------------------------------------

Hi [~twalthr] [~sunjincheng121] , I have invested deeper into this issue and 
have some problems to confirm with you. Would be great to have your suggestions.

*Dependency Jiras*
This issue may be blocked by the following tasks.
1.FLINK-11068 converting Table to an interface.
2.FLINK-11532 Port ExternalCatalog in order to put `registerExternalCatalog()` 
in `TableEnvironment`
3.FLINK-11516 Port StreamTableDescriptor, BatchTableDescriptor to API module in 
order to put `connect()` in `StreamTableEnvironment` or `BatchTableEnvironment`

*TableConfig*
TableConfig should be exist in API module as it is used to create 
TableEnvironment, such as `BatchTableEnvironment.create(env, new 
TableConfig());`. However, currently, TableConfig depends on Calcite. To make 
it calcite free, we can rename the current TableConfig to `InternalTableConfig` 
and add another api TableConfig. The `InternalTableConfig` extends 
`TableConfig`. In `TableConfig`, there are no calcite related methods. Users 
who want to set calcite config could use the config in the following way:
{code:java}
tableEnv.getConfig.asInstanceOf[InternalTableConfig].setCalciteConfig(cc)
{code}
*TableEnvironment interface*
There are 5 TableEnvironment interfaces:
{code:java}
// in table-api-java-bridge
org.apche.flink.table.api.java.BatchTableEnvironment
org.apche.flink.table.api.java.StreamTableEnvironment
// in table-api-scala-bridge
org.apche.flink.table.api.scala.BatchTableEnvironment
org.apche.flink.table.api.scala.StreamTableEnvironment
// in table-api-java 
org.apche.flink.table.api.TableEnvironment
{code}
Take `java.BatchTableEnvironment` as an example, it contains a static method 
`static StreamTableEnvironment create(StreamExecutionEnvironment 
executionEnvironment, TableConfig tableConfig)`. The `create` method uses 
reflection to create a TableEnvironment instance now. We can replace reflection 
strategy to discovery strategy when introducing Planner. 


was (Author: hequn8128):
Hi [~twalthr], I have invested deeper into this issue and have some problems to 
confirm with you. Would be great to have your suggestions.

*Dependency Jiras*
This issue may be blocked by the following tasks.
1.FLINK-11068 converting Table to an interface.
2.FLINK-11532 Port ExternalCatalog in order to put `registerExternalCatalog()` 
in `TableEnvironment`
3.FLINK-11516 Port StreamTableDescriptor, BatchTableDescriptor to API module in 
order to put `connect()` in `StreamTableEnvironment` or `BatchTableEnvironment`

*TableConfig*
TableConfig should be exist in API module as it is used to create 
TableEnvironment, such as `BatchTableEnvironment.create(env, new 
TableConfig());`. However, currently, TableConfig depends on Calcite. To make 
it calcite free, we can rename the current TableConfig to `InternalTableConfig` 
and add another api TableConfig. The `InternalTableConfig` extends 
`TableConfig`. In `TableConfig`, there are no calcite related methods. Users 
who want to set calcite config could use the config in the following way:
{code:java}
tableEnv.getConfig.asInstanceOf[InternalTableConfig].setCalciteConfig(cc)
{code}
*TableEnvironment interface*
There are 5 TableEnvironment interfaces:
{code:java}
// in table-api-java-bridge
org.apche.flink.table.api.java.BatchTableEnvironment
org.apche.flink.table.api.java.StreamTableEnvironment
// in table-api-scala-bridge
org.apche.flink.table.api.scala.BatchTableEnvironment
org.apche.flink.table.api.scala.StreamTableEnvironment
// in table-api-java 
org.apche.flink.table.api.TableEnvironment
{code}
Take `java.BatchTableEnvironment` as an example, it contains a static method 
`static StreamTableEnvironment create(StreamExecutionEnvironment 
executionEnvironment, TableConfig tableConfig)`. The `create` method uses 
reflection to create a TableEnvironment instance now. We can replace reflection 
strategy to discovery strategy when introducing Planner. 

> Convert TableEnvironments to interfaces
> ---------------------------------------
>
>                 Key: FLINK-11067
>                 URL: https://issues.apache.org/jira/browse/FLINK-11067
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Hequn Cheng
>            Priority: Major
>
> A more detailed description can be found in 
> [FLIP-32|https://cwiki.apache.org/confluence/display/FLINK/FLIP-32%3A+Restructure+flink-table+for+future+contributions].
> This task includes porting {{TableEnvironment}}, {{StreamTableEnvironment}}, 
> {{BatchTableEnvironment}} to Java interfaces. API-breaking changes should not 
> be necessary anymore as they should have been resolved by sibling issues. 
> Some refactoring and clean up might be necessary.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to