YifanZhang created IMPALA-12562:
-----------------------------------

             Summary: CAST(ROUND(INT a/ INT b, INT d)) as STRING) may return 
wrong result
                 Key: IMPALA-12562
                 URL: https://issues.apache.org/jira/browse/IMPALA-12562
             Project: IMPALA
          Issue Type: Bug
            Reporter: YifanZhang


The following query returns a wrong result:
{code:java}
 select cast(round(1/3*100, 2) as string)

+---------------------------------+
| cast(round(1 / 3, 2) as string) |
+---------------------------------+
| 0.33000000000000002             |
+---------------------------------+
Fetched 1 row(s) in 0.11s {code}
Remove the cast function and the result is expected:
{code:java}
 select round(1/3,2);

+-----------------+
| round(1 / 3, 2) |
+-----------------+
| 0.33            |
+-----------------+ {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to