You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Hequn Cheng (JIRA)" <ji...@apache.org> on 2017/12/22 02:27:00 UTC

[jira] [Closed] (CALCITE-1979) Case When result type precision problem

     [ https://issues.apache.org/jira/browse/CALCITE-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hequn Cheng closed CALCITE-1979.
--------------------------------
    Resolution: Won't Do

> Case When result type precision problem
> ---------------------------------------
>
>                 Key: CALCITE-1979
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1979
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Hequn Cheng
>            Assignee: Julian Hyde
>
> Considering such query:
> {quote}
> "SELECT a, case when c = 'Hi' then 'ARRIVAL' else 'DEPARTURE' end as cc, b FROM sourceTable"
> {quote}
> The result type of {{case when}} will be {{BasicSqlType}} with precision 9. This makes "ARRIVAL" to "ARRIVAL   " with two spaces behind.  But what users want is just "ARRIVAL".
> Also users may write the following query(with one space behind ARRIVAL):
> {quote}
> "SELECT a, case when c = 'Hi' then 'ARRIVAL ' else 'DEPARTURE' end as cc, b FROM sourceTable"
> {quote}
> The result type of {{case when}} will also be {{BasicSqlType}} with precision 9, which makes no differences to the first query.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)