Hi All, According to the feedback from users, the design of TableEnvironment is very inconvenient for users, and often mistakenly imported by IDE, especially for Java users, such as:
ExecutionEnvironment env = ... BatchTableEnvironment tEnv = TableEnvironment.getTableEnvironment(env); The user does not know which BatchTableEnvironment should be imported, because there are three implementations of BatchTableEnvironment, shown as below: 1. org.apache.flink.table.api.BatchTableEnvironment 2. > org.apache.flink.table.api.java.BatchTableEnvironment 3. > org.apache.flink.table.api.scala.BatchTableEnvironment [image: image.png] This brings unnecessary inconveniences to the flink user. To solve this problem, Wei Zhong, Hequn Cheng, Dian Fu, Shaoxuan Wang and myself discussed offline a bit and propose to change the inheritance diagram of TableEnvironment is shown as follows: 1. AbstractTaleEnvironment - rename current TableEnvironment to > AbstractTableEnvironment, The functionality implemented by Abstract > TableEnvironment is stream and batch shared. 2. TableEnvironment - Create a new TableEnvironment(abstract), and defined > all methods in (java/scala)StreamTableEnvironment and > (java/scala)BatchTableEnvironment. In the implementation of > BatchTableEnviroment and StreamTableEnviroment, the unsupported operations > will be reported as an error. [image: image.png] Then the usage as follows: ExecutionEnvironment env = … TableEnvironment tEnv = TableEnvironment.getTableEnvironment(env) For detailed proposals please refer to the Google doc: https://docs.google.com/document/d/1t-AUGuaChADddyJi6e0WLsTDEnf9ZkupvvBiQ4yTTEI/edit?usp=sharing Any mail feedback and Google doc comment are welcome. Thanks, Jincheng