[ 
https://issues.apache.org/jira/browse/SPARK-20786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

caoxuewen updated SPARK-20786:
------------------------------
    Summary: Improve ceil and floor handle the value which is not expected  
(was: Improve ceil handle the value which is not expected)

> Improve ceil and floor handle the value which is not expected
> -------------------------------------------------------------
>
>                 Key: SPARK-20786
>                 URL: https://issues.apache.org/jira/browse/SPARK-20786
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: caoxuewen
>
> spark-sql>SELECT ceil(1234567890123456);
> 1234567890123456
> spark-sql>SELECT ceil(12345678901234567);
> 12345678901234568
> spark-sql>SELECT ceil(123456789012345678);
> 123456789012345680
> when the length of the getText is greater than 16. long to double will be 
> precision loss.
> but mysql handle the value is ok.
> mysql> SELECT ceil(1234567890123456);
> +------------------------+
> | ceil(1234567890123456) |
> +------------------------+
> |       1234567890123456 |
> +------------------------+
> 1 row in set (0.00 sec)
> mysql> SELECT ceil(12345678901234567);
> +-------------------------+
> | ceil(12345678901234567) |
> +-------------------------+
> |       12345678901234567 |
> +-------------------------+
> 1 row in set (0.00 sec)
> mysql> SELECT ceil(123456789012345678);
> +--------------------------+
> | ceil(123456789012345678) |
> +--------------------------+
> |       123456789012345678 |
> +--------------------------+
> 1 row in set (0.00 sec)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to