Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Query with GROUP BY and JOIN ... USING wrongly fails with "Column 'DEPTNO' is ambiguous" error. Here is the query:
select deptno, count(*) from emp join dept using (deptno) group by deptno;
Because of USING, the two deptno fields should be merged into one, and therefore deptno is not ambiguous. That query works in Oracle. Also note that
select deptno from emp join dept using (deptno)
works correctly in Calcite, and has since CALCITE-2227 was fixed.
Attachments
Issue Links
- is related to
-
CALCITE-2227 "SELECT *" in a NATURAL JOIN and JOIN USING query should output join columns only once
- Closed
- relates to
-
CALCITE-4915 Query with unqualified common column and NATURAL JOIN fails
- In Progress
-
CALCITE-2672 In JOIN ... USING and NATURAL JOIN, common columns should be unambiguous
- Closed
- links to