You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hequn Cheng (JIRA)" <ji...@apache.org> on 2019/02/01 13:43:00 UTC

[jira] [Commented] (FLINK-11447) Deprecate "new Table(TableEnvironment, String)"

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

Hequn Cheng commented on FLINK-11447:
-------------------------------------

Hi, [~twalthr]. I agree that we don't need to complete in sync with SQL in TableAPI. And yes, it is very unlikely that we will ever support correlated subqueries in Table API.

Hi, [~dawidwys]. I agree with you that we would better not to introduce the Lateral.subquery concept for now. Such a feature would definitely need another big discussion. 

Thanks again for your nice comments. I joined the discussion as I saw some good points raised by the second option listed by [~sunjincheng121]:
 - Don't need to add another kind of join.
 - The right side of join should be a Table.

I would like to share more thoughts for these two points.
1. We don't need to add another kind of join. 
The semantic of `joinLateral` is exactly same to `inner join`, i.e., it is not a left join, nor a right join. It is more clear to use `join`. We only need another kind of join if it acts differently. For example, we need to add antiJoin/semiJoin as they join two tables differently.

2. The right side of the join should be a Table.
We can only join two tables. I think this is the problem we need to solve when we make Table interface. And I'd like to propose a solution as follows.
{code:java}
object Table {
  def create(tEnv: TableEnvironment, expr: String): Table = {
    tEnv.createTable(expr)
  }
}
{code}
Similar to {{TableEnvironment.create()}}, we can also add a create method for Table. The query written by user would be {{table.join(Table.create(tEnv, "xxx"))}}, similar to the query before, {{table.join(new Table(tEnv, "xxx"))}}

What do you guys think?

> Deprecate "new Table(TableEnvironment, String)"
> -----------------------------------------------
>
>                 Key: FLINK-11447
>                 URL: https://issues.apache.org/jira/browse/FLINK-11447
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API &amp; SQL
>            Reporter: Timo Walther
>            Assignee: Dian Fu
>            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].
> Once table is an interface we can easily replace the underlying implementation at any time. The constructor call prevents us from converting it into an interface.



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