You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2021/07/12 10:32:00 UTC
[jira] [Resolved] (CALCITE-4674) Excess quotes in generated SQL
when STAR is a column alias
[ https://issues.apache.org/jira/browse/CALCITE-4674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stamatis Zampetakis resolved CALCITE-4674.
------------------------------------------
Resolution: Fixed
Fixed in [d7290e723a30862da5e69d3b7cc558e22d58b661|https://github.com/apache/calcite/commit/d7290e723a30862da5e69d3b7cc558e22d58b661].
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.28.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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)