Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1979

Case When result type precision problem

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • None
    • None
    • core
    • None

    Description

      Considering such query:

      "SELECT a, case when c = 'Hi' then 'ARRIVAL' else 'DEPARTURE' end as cc, b FROM sourceTable"

      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):

      "SELECT a, case when c = 'Hi' then 'ARRIVAL ' else 'DEPARTURE' end as cc, b FROM sourceTable"

      The result type of case when will also be BasicSqlType with precision 9, which makes no differences to the first query.

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            hequn8128 Hequn Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: