You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Taras Bobrovytsky (JIRA)" <ji...@apache.org> on 2017/11/13 23:48:00 UTC

[jira] [Created] (IMPALA-6183) Converting Decimal to Double loses precision

Taras Bobrovytsky created IMPALA-6183:
-----------------------------------------

             Summary: Converting Decimal to Double loses precision
                 Key: IMPALA-6183
                 URL: https://issues.apache.org/jira/browse/IMPALA-6183
             Project: IMPALA
          Issue Type: Bug
          Components: Backend
    Affects Versions: Impala 2.10.0, Impala 2.9.0, Impala 2.8.0, Impala 2.7.0, Impala 2.11.0
            Reporter: Taras Bobrovytsky
            Assignee: Taras Bobrovytsky


The following query returns a correct result:
{code}
select cast(1.1112223334445559 as double)
{code}

Result:
{code}
1.111222333444556
{code}

However, if we first convert the literal to a decimal, we lose precision.
{code}
select cast(cast(1.1112223334445559 as decimal(38, 37)) as double)
{code}

Result:
{code}
1.111222340799091
{code}



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