You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2018/11/15 11:13:00 UTC

[jira] [Commented] (FLINK-10873) Remove tableEnv in DataSetConversions#toTable and DataStreamConversions#toTable

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

Fabian Hueske commented on FLINK-10873:
---------------------------------------

It would be nice to remove the parameter, but I think this is not easily possible.
At the moment, we can only join (union, intersect, etc) tables that were registered in the same TableEnvironment.
So by removing the TableEnvironment parameter, we cannot run such queries anymore because each table would generate its own table environment.

Disclaimer, this we at least the current state when we started to work on the table API. It might make sense to check if the limitiation still exists or if we can work around it.

> Remove tableEnv in DataSetConversions#toTable and DataStreamConversions#toTable
> -------------------------------------------------------------------------------
>
>                 Key: FLINK-10873
>                 URL: https://issues.apache.org/jira/browse/FLINK-10873
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Jeff Zhang
>            Assignee: Hequn Cheng
>            Priority: Major
>
> What I would like to achieve is to change the following code
> {code}
>     val table = data.flatMap(line=>line.split("\\s"))
>       .map(w => (w, 1))
>       .toTable(tEnv, 'word, 'count)
> {code}
> to this
> {code}
>     val table = data.flatMap(line=>line.split("\\s"))
>       .map(w => (w, 1))
>       .toTable('word, 'count)
> {code}
> The only change is that tableEnv is removed in method toTable.  I think the second piece of code is more readable. We can create TableEnvironment based on the ExecutionEnvironment of DataSet/DataStream rather than asking user to pass it explicitly. 



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