Stamatis Zampetakis created CALCITE-4674:
--------------------------------------------

             Summary: Excess quotes in generated SQL when STAR is a column alias
                 Key: CALCITE-4674
                 URL: https://issues.apache.org/jira/browse/CALCITE-4674
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.27.0
            Reporter: Stamatis Zampetakis
            Assignee: Stamatis Zampetakis
             Fix For: 1.28.0


The following valid SQL query:

{code:sql}
select "customer_id" as "*" from "customer";
{code}

changes slightly semantics when it is parsed, optimized, and transformed back 
to SQL via {{RelToSqlConverter}}. 

+Actual+
{code:sql}
SELECT "customer_id" AS """*""" FROM "foodmart"."customer";
{code}

Note the extra quotes appearing in the {{AS}} clause. Aliasing columns 
differently is undesirable and can have an impact when this query pattern 
appears as part of a larger query and there are usages of the alias.

+Expected+
{code:sql}
SELECT "customer_id" AS "*" FROM "foodmart"."customer";
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to