Hequn Cheng created CALCITE-1979:
------------------------------------

             Summary: 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.  
Also users may write the following query(with one space behind ARRIVAL):
"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.
These may not what the users want. And I am wondering if there is a way to 
solve this problem?



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

Reply via email to