Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-6518

Fix the output type of a decimal union for decimal_v2

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 3.0
    • Fix Version/s: Impala 3.0, Impala 2.13.0
    • Component/s: Frontend
    • Labels:
      None
    • Epic Color:
      ghx-label-9

      Description

      In the following query, the type of c1 is decimal(38, 38) for both decimal v1 and v2.

      select c1 from (
      select cast(1 as decimal(38, 0)) as c1
      union all
      select cast(0.1 as decimal(38, 38)) as c1) t

      This means that we are truncating from the front. It would make more sense to truncate from the back and round when decimal v2 is enabled. The output type should be (38, 6). This is what we do for other mathematical operations, such as addition.

        Attachments

          Activity

            People

            • Assignee:
              tarasbob Taras Bobrovytsky
              Reporter:
              tarasbob Taras Bobrovytsky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: