Skip to content

Nested JOIN leads to IllegalStateException: joinPairs contains duplicate  #13503

@proddata

Description

@proddata

CrateDB version

5.1.3 / master

CrateDB setup information

No response

Problem description

Not entirely sure if this is a 🐛 or just unsupported.
Came up in crate/cratedb-examples#10 (comment)

Steps to Reproduce

CREATE TABLE j1 (x INT);                                                    
CREATE TABLE j2 (x INT);                                                    
CREATE TABLE j3 (x INT);
                                                    
cr> SELECT * 
    FROM j1 
    JOIN (j2 JOIN j3 ON j2.x = j3.x) 
    ON j1.x = j2.x;                                                             
IllegalStateException[joinPairs contains duplicate: Join{INNER doc.j2doc.j3} matches Join{INNER doc.j2doc.j3}]

Actual Result

IllegalStateException[joinPairs contains duplicate: Join{INNER doc.j2 ⇔ doc.j3} matches Join{INNER doc.j2 ⇔ doc.j3}]

Expected Result

 x | x | x 
---+---+---
(0 rows)

Metadata

Metadata

Assignees

Labels

bugClear identification of incorrect behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions