Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

rounding problem with round func #1213

Open
jackylee-ch opened this issue Jan 13, 2023 · 2 comments
Open

rounding problem with round func #1213

jackylee-ch opened this issue Jan 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jackylee-ch
Copy link
Contributor

jackylee-ch commented Jan 13, 2023

Describe the bug
round(0.0157345, 6) return 0.015734

@jackylee-ch jackylee-ch added the bug Something isn't working label Jan 13, 2023
@zhouyuan
Copy link
Collaborator

may due to the float type precision issue

@ccat3z
Copy link

ccat3z commented Jan 31, 2023

Spark round float/double by converting to BigDecimal, maybe we can copy the convert logic of double and decimal in java.

https://github.com/apache/spark/blob/a056f694386cc074219914debf7023f5935bc37d/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala#L1564

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants