[ https://issues.apache.org/jira/browse/FLINK-3738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15241195#comment-15241195 ]
ASF GitHub Bot commented on FLINK-3738: --------------------------------------- GitHub user fhueske opened a pull request: https://github.com/apache/flink/pull/1887 [FLINK-3738] [tableAPI] Refactor TableEnvironments. Remove Translators and TranslationContext. - [X] General - The pull request references the related JIRA issue - The pull request addresses only one issue - Each commit in the PR has a meaningful commit message - [X] Documentation - Documentation has been added for new functionality - Old documentation affected by the pull request has been updated - JavaDoc for public methods has been added - [X] Tests & Build - Functionality added by the pull request is covered by tests - `mvn clean verify` has been executed successfully locally or a Travis build has passed - Removes Translators (JavaBatchTranslator, ScalaBatchTranslator, JavaStreamTranslator, ScalaStreamTranslator) - Removes TranslationContext - Creates TableEnvironments for Java/Scala DataSet/DataStream APIs - Functionality of translators and translation context is moved to table environments - Tables are bound to a TableEnvironment - Simplifies table translation from and to DataSet / DataStream. - Updates documentation and cleaned up ScalaDocs You can merge this pull request into a Git repository by running: $ git pull https://github.com/fhueske/flink tableEnv Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/1887.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1887 ---- commit f9f7f1dfb00036d903e0e0d514be52000c26a826 Author: Fabian Hueske <fhue...@apache.org> Date: 2016-04-12T16:48:38Z [FLINK-3738] [tableAPI] Refactor TableEnvironments. Remove Translators and TranslationContext. - Removes Translators (JavaBatchTranslator, ScalaBatchTranslator, JavaStreamTranslator, ScalaStreamTranslator) - Removes TranslationContext - Creates TableEnvironments for Java/Scala DataSet/DataStream APIs - Functionality of translators and translation context is moved to table environments - Tables are bound to a TableEnvironment - Simplifies table translation from and to DataSet / DataStream. - Updates documentation and cleaned up ScalaDocs ---- > Refactor TableEnvironment and TranslationContext > ------------------------------------------------ > > Key: FLINK-3738 > URL: https://issues.apache.org/jira/browse/FLINK-3738 > Project: Flink > Issue Type: Task > Components: Table API > Reporter: Fabian Hueske > Assignee: Fabian Hueske > > Currently the TableAPI uses a static object called {{TranslationContext}} > which holds the Calcite table catalog and a Calcite planner instance. > Whenever a {{DataSet}} or {{DataStream}} is converted into a {{Table}} or > registered as a {{Table}} on the {{TableEnvironment}}, a new entry is added > to the catalog. The first time a {{Table}} is added, a planner instance is > created. The planner is used to optimize the query (defined by one or more > Table API operations and/or one ore more SQL queries) when a {{Table}} is > converted into a {{DataSet}} or {{DataStream}}. Since a planner may only be > used to optimize a single program, the choice of a single static object is > problematic. > I propose to refactor the {{TableEnvironment}} to take over the > responsibility of holding the catalog and the planner instance. > - A {{TableEnvironment}} holds a catalog of registered tables and a single > planner instance. > - A {{TableEnvironment}} will only allow to translate a single {{Table}} > (possibly composed of several Table API operations and SQL queries) into a > {{DataSet}} or {{DataStream}}. > - A {{TableEnvironment}} is bound to an {{ExecutionEnvironment}} or a > {{StreamExecutionEnvironment}}. This is necessary to create data source or > source functions to read external tables or streams. > - {{DataSet}} and {{DataStream}} need a reference to a {{TableEnvironment}} > to be converted into a {{Table}}. This will prohibit implicit casts as > currently supported for the DataSet Scala API. > - A {{Table}} needs a reference to the {{TableEnvironment}} it is bound to. > Only tables from the same {{TableEnvironment}} can be processed together. > - The {{TranslationContext}} will be completely removed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)