Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Let's say set of columns passed to this API are join keys and there is one NULL key coming from both the inputs. Following code will return true which is wrong because the result of FULL. OUTER JOIN with NULL key on both side will produce two rows with NULL. Even though this value in respective input is unique the result of join may not be unique.
Boolean leftUnique = mq.areColumnsUnique(left, leftColumns, ignoreNulls); Boolean rightUnique = mq.areColumnsUnique(right, rightColumns, ignoreNulls); if ((leftColumns.cardinality() > 0) && (rightColumns.cardinality() > 0)) { if ((leftUnique == null) || (rightUnique == null)) { return null; } else { return leftUnique && rightUnique; } }
create table trepro(i int); insert into trepro values(null); select * from trepro t1 full outer join trepro t2 on t1.i=t2.i; null, null null, null
Attachments
Issue Links
- is depended upon by
-
CALCITE-3011 Support left and right outer joins with AggregateJoinTransposeRule
- Closed
- links to