Martijn Visser created FLINK-41819:
--------------------------------------
Summary: Multi-way join fails with "Field names must be unique"
when a column appears in two equalities
Key: FLINK-41819
URL: https://issues.apache.org/jira/browse/FLINK-41819
Project: Flink
Issue Type: Bug
Components: Table SQL / Runtime
Affects Versions: 2.3.0, 2.2.0, 2.1.0
Reporter: Martijn Visser
With {{table.optimizer.multi-join.enabled}}, a query that compares one column
of an input in two equalities fails when the job starts:
{code:sql}
SELECT * FROM a JOIN b ON b.k = a.k AND b.y = a.x AND b.y = a.y LEFT JOIN c ON
c.k = a.k
{code}
{code}
org.apache.flink.table.api.ValidationException: Field names must be unique.
Found duplicates: [y_key]
{code}
{{AttributeBasedJoinKeyExtractor#buildJoinKeyType}} names each join key field
after its column with a {{_key}} suffix, so the join key of b gets {{y_key}}
twice. The binary joins run the query. This has been the case since FLINK-37481.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)