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

Converting Decimal to Double loses precision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.7.0, Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0
    • Impala 2.11.0
    • Backend
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: