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

Converting Decimal to Double loses precision

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.7.0, Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0
    • Fix Version/s: Impala 2.11.0
    • Component/s: Backend
    • Labels:
      None
    • Docs Text:
      Flag this in release notes as an "incompatible change".
    • Epic Color:
      ghx-label-1

      Description

      The following query returns a correct result:

      select cast(1.1112223334445559 as double)
      

      Result:

      1.111222333444556
      

      However, if we first convert the literal to a decimal, we lose precision.

      select cast(cast(1.1112223334445559 as decimal(38, 37)) as double)
      

      Result:

      1.111222340799091
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: