hequn8128 opened a new pull request #8050: [FLINK-11067][table] Convert TableEnvironments to interfaces URL: https://github.com/apache/flink/pull/8050 ## What is the purpose of the change This pull request converts TableEnvironments to interfaces. ## Brief change log ### TableEnvironment interface There are 5 TableEnvironment interfaces: ``` // 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 ``` 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. ### TableConfig - Rename CalciteConfig to PlannerConfig. - Add DefaultPlannerConfig in flink-table-planner ### BatchTableDescriptor & StreamTableDescriptor - Port BatchTableDescriptor and StreamTableDescriptor to api-java, so that the connect() method in StreamTableEnvironment can return StreamTableDescriptor. This makes the api compitable. - There are other classes that have to be ported into common, such as `FieldComputer`, `Rowtime`, `Schema`, etc. When porting `WatermarkStrategy`, it affects the result of serialization resulting in incompatibility. It seems there are no better ways to achive compatibility. - Convert `TableFactoryUtil` into interface as it is used in ConnectTableDescriptor which needs to be ported into api-java. ### other changes - Remove duplicate comments in TableEnvImpl. We have moved these comments into the interface. - This pr takes no consideration of blink. I opened another jira([FLINK-12016](https://issues.apache.org/jira/browse/FLINK-12016)) to address the problem of Blink. In the jira we need to rename the package name of blink, because a lot of classes was copied from flink directly which brings class conflict when we port TableEnvironment into api module. ## Verifying this change This change is already covered by existing tests. Also `ScalaTableEnvironmentCreationValidationTest` and `JavaTableEnvironmentCreationValidationTest` have been added to test the creation of table environments. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (yes) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (no)
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
