I want to use Flink Table API to join two tables on the same field.
I want to implement
SELECT
a.id
b.id
FROM
table1 AS a
JOIN
table2 AS b
ON
a.id = b.id
I tried, but found the only way to achieve my goal was like
val table1 = tableEnv.fromDataSet(dbData, "id1")
val table2 = tableEnv.fromDataSet(dbData, "id2")
val res = table1.join(table2).where("id1=id2")
But I want to reuse the key "id".
I found this on Flink Documentation:
Both tables must have distinct field names and an equality join predicate must be defined using a where or filter operator.
How can I reuse the filed key?