You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dian Fu (Jira)" <ji...@apache.org> on 2020/07/23 05:28:00 UTC
[jira] [Updated] (FLINK-18679) It doesn't support to join two
tables containing the same field names in Table API
[ https://issues.apache.org/jira/browse/FLINK-18679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dian Fu updated FLINK-18679:
----------------------------
Description:
For example, if we have two tables which have the same field name "int1" and want to join the two tables on this field:
{code:java}
val t1 = util.addTable[(Int, Long, String)]('int1, 'long1, 'string1)
val t2 = util.addTable[(Int, Long, String)]('int1, 'long2, 'string2)
{code}
In SQL, we could do it as following:
{code:java}
SELECT xxx
FROM t1 JOIN t2 ON t1.int1 = t2.int1
{code}
However, this is not possible in Table API. It lacks a way to specify a column from one table. We have to rename the field name from one table to make sure that all the field names are unique before joining them. This is very inconvenient.
was:
For example, if we have two tables which have the same field named "int1" and want to join the two tables on this field:
{code:java}
val t1 = util.addTable[(Int, Long, String)]('int1, 'long1, 'string1)
val t2 = util.addTable[(Int, Long, String)]('int1, 'long2, 'string2)
{code}
In SQL, we could do it as following:
{code:java}
SELECT xxx
FROM t1 JOIN t2 ON t1.int1 = t2.int1
{code}
However, this is not possible in Table API. It lacks a way to specify a column from one table. We have to rename the field name from one table to make sure that all the field names are unique before joining them. This is very inconvenient.
> It doesn't support to join two tables containing the same field names in Table API
> ----------------------------------------------------------------------------------
>
> Key: FLINK-18679
> URL: https://issues.apache.org/jira/browse/FLINK-18679
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Dian Fu
> Priority: Major
>
> For example, if we have two tables which have the same field name "int1" and want to join the two tables on this field:
> {code:java}
> val t1 = util.addTable[(Int, Long, String)]('int1, 'long1, 'string1)
> val t2 = util.addTable[(Int, Long, String)]('int1, 'long2, 'string2)
> {code}
> In SQL, we could do it as following:
> {code:java}
> SELECT xxx
> FROM t1 JOIN t2 ON t1.int1 = t2.int1
> {code}
> However, this is not possible in Table API. It lacks a way to specify a column from one table. We have to rename the field name from one table to make sure that all the field names are unique before joining them. This is very inconvenient.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)