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 2018/08/29 23:37:00 UTC

[jira] [Commented] (CALCITE-2507) Aliasing a star in select list should throw a parsing error.

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

Julian Hyde commented on CALCITE-2507:
--------------------------------------

Agreed. And {{select t.*  as x from t}} should be invalid too. Even if {{t}} has precisely one column.

> Aliasing a star in select list should throw a parsing error. 
> -------------------------------------------------------------
>
>                 Key: CALCITE-2507
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2507
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Hanumath Rao Maduri
>            Assignee: Julian Hyde
>            Priority: Minor
>             Fix For: 1.18.0
>
>
> Currently aliasing a Star column is not throwing an exception in parser. There is a TODO for a simple test case (in SqlParserTest.java) to throw an error in parser phase itself. 
> Change the parser grammar so as to report an error in parsing phase itself. 
> {code:java}
> // TODO: should fail in parser
> @Test public void testStarAsFails() {
> sql("select * as x from emp")
> .ok("SELECT * AS `X`\n"
> + "FROM `EMP`");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)