Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.21.0
Description
The issue can be reproduced by adding the following test to EnumerablesTest.java:
@Test public void testNestedLoopSemiJoin() { assertThat( EnumerableDefaults.nestedLoopJoin(DEPTS, EMPS, (d, e) -> d.deptno == e.deptno, (d, e) -> d.toString(), JoinType.SEMI).toList().toString(), equalTo("[Dept(20, Sales)]")); }
This test performs a "DEPT semi-join EMP" (i.e. select all departments which have at least one employee):
SELECT * FROM DEPT WHERE EXISTS (SELECT 1 FROM EMP WHERE DEPT.DEPTNO = EMP.DEPTNO)
This semi-join query must not return duplicates, however the test returns them (it returns "Sales" two times because it has two employees, but this is wrong, it should be returned just once):
Expected: "[Dept(20, Sales)]" but: was "[Dept(20, Sales), Dept(20, Sales)]"
Attachments
Issue Links
- links to