Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
"SELECT *" in a NATURAL JOIN and JOIN USING query should output join columns only once.
For example,
SELECT * FROM Emp NATURAL JOIN Dept
should give columns
{deptno, empno, ename, dname}. Note that deptno, the join key, has been moved to the start of the list only occurs once.
This behavior is specified in the SQL standard. I don't know how I missed it.
For outer joins, the value is coalesce(left.key, right.key) therefore never null.
Attachments
Issue Links
- relates to
-
CALCITE-2400 Allow standards-compliant column ordering for NATURAL JOIN and JOIN USING when dynamic tables are used
- Open
-
CALCITE-3387 Query with GROUP BY and JOIN ... USING wrongly fails with "Column 'DEPTNO' is ambiguous" error
- Closed
-
CALCITE-5547 JOIN USING returns incorrect column names
- Closed