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

Some math functions return different results between 0.11.0 and 0.12.1 #10637

Open
elonazoulay opened this issue Apr 18, 2023 · 4 comments
Open

Comments

@elonazoulay
Copy link
Contributor

Example: exp(2 * ln(3)) returns 8.999999999999998 in 0.11.0 and 9.000000000000002 in 0.12.1.

To repro:

select <column>, exp(2 * ln(3)) from <table>

for any table. The result is computed during parsing.

elonazoulay added a commit to elonazoulay/presto-1 that referenced this issue Apr 18, 2023
This is due to differences in how Pinot handles IEEE-754
approximate numerics pre/post Pinot 0.12.1.

See apache/pinot#10637
@Jackie-Jiang
Copy link
Contributor

Interesting.. We use Math library to calculate these values, and there should be no change between these 2 versions. Could it be caused by different jvm?

@elonazoulay
Copy link
Contributor Author

For testing, I'm running the same version of everything except the pinot docker image - same config and args.
Both the 0.12.1 and 0.11.0 image use java 11.0.16.

elonazoulay added a commit to elonazoulay/presto-1 that referenced this issue Apr 20, 2023
This is due to differences in how Pinot handles IEEE-754
approximate numerics pre/post Pinot 0.12.1.

See apache/pinot#10637
hashhar pushed a commit to trinodb/trino that referenced this issue Apr 20, 2023
This is due to differences in how Pinot handles IEEE-754
approximate numerics pre/post Pinot 0.12.1.

See apache/pinot#10637
@Jackie-Jiang
Copy link
Contributor

I tried Math.exp(2 * Math.log(3)) and got 9.000000000000002, so I guess this result is expected. IMO both of them are correct, and maybe we should just use fuzzy compare when validating floating point values

@61yao
Copy link
Contributor

61yao commented Apr 27, 2023

@Jackie-Jiang Should we get #10650 merged first to solve the incompatibility problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants