Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Result mismatch in cast(float|double as string) #8959

Open
ccat3z opened this issue Mar 11, 2025 · 0 comments
Open

[VL] Result mismatch in cast(float|double as string) #8959

ccat3z opened this issue Mar 11, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@ccat3z
Copy link
Contributor

ccat3z commented Mar 11, 2025

Backend

VL (Velox)

Bug description

Velox always produce fixed precision scientific notation when cast number less equal 1E-3 or greater equal 1E7. But vanilla spark produce shortest scientific notation.

cast(double as string)
5.957E-4 -> 5.9570000000000001E-4
1.0E-6 -> 9.9999999999999995E-7
7.639E-4 -> 7.6389999999999997E-4

facebookincubator/velox#12574 may fix fixed-precision issue, but the results are still mismatch due to https://bugs.openjdk.org/browse/JDK-4511638. Double.toString in java < 19 may product incorrect and longer result, for example:

Double Double.toString JDK <= 18 JDK 19, Other IEEE 754 C++ Implements
7.5371334E25 7.5371335E25 7.5371334E25 # incorrect
carrier uint64 4994259165719689788 4994259165603274466
1.0E23 9.999999999999999E22 1.0E23 # longer
carrier uint64 4950912855330343670 4950912855330343670

Spark version

None

Spark configurations

No response

System information

No response

Relevant logs

@ccat3z ccat3z added bug Something isn't working triage labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant