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

Julian Hyde commented on CALCITE-1535:
--------------------------------------

Looks good. I added some extra tests.

I disagree with you on a couple of minor points:
* We should use nameMatcher, so that case-insensitive sessions get 
case-insensitive matches;
* I don't think we should treat columns with explicit aliases ("AS name") 
differently than ones with implicit aliases ("t.name").

But I do agree that columns in the SELECT clause override this that are in 
tables in the FROM clause. For example, {{SELECT dept.deptno FROM dept, emp 
ORDER BY deptno}} is valid, because though both {{emp}} and {{dept}} have a 
column called {{deptno}}, there is only one {{deptno}} column in the SELECT 
clause.

Please review my fix up in 
https://github.com/julianhyde/calcite/tree/1535-ambiguous-order-by.

> Give error if ORDER BY clause references ambiguous column name
> --------------------------------------------------------------
>
>                 Key: CALCITE-1535
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1535
>             Project: Calcite
>          Issue Type: Improvement
>    Affects Versions: 1.11.0
>            Reporter: Dongming Liu
>            Assignee: Julian Hyde
>
> When I use calcite, I found follow sql can convert to a RelNode correctly.
> {code} 
> SELECT id AS t1, name AS t1 FROM T ORDER BY t1
> {code}
> The column name t1 for {{ORDER BY}} is ambiguous, should check at validation?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to