You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2021/12/07 01:08:00 UTC

[jira] [Commented] (CALCITE-4922) Unqualified common column in ORDER BY fails for JOINs with USING and for NATURAL JOINs

    [ https://issues.apache.org/jira/browse/CALCITE-4922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17454318#comment-17454318 ] 

Julian Hyde commented on CALCITE-4922:
--------------------------------------

Definitely a bug. Thanks for logging it.

Since {{ORDER BY}} can (in most compliances) see column aliases in the {{SELECT}} clause, and since these also appear as unqualified column names, can you test what happens when these rules conflict. E.g. {{{}SELECT empno AS deptno FROM emp NATURAL JOIN dept ORDER BY deptno{}}}. Add to a {{.iq}} test file with comments about what you are trying to break.

> Unqualified common column in ORDER BY fails for JOINs with USING and for NATURAL JOINs
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4922
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4922
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>
> Query:
> {noformat}
> SELECT name FROM emp JOIN dept USING (deptno) ORDER BY deptno{noformat}
> Fails with:
> {noformat}
> Column 'DEPTNO' is ambiguous{noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)