fix: make tan and atan2 compatible#3849
Merged
kazuyukitanimura merged 10 commits intoapache:mainfrom Apr 10, 2026
Merged
Conversation
Member
|
Thanks @kazuyukitanimura. Could you add SQL file based tests, since this is preferred approach now. See #3854 for example. |
Contributor
Author
Thanks @andygrove, updated spark/src/test/resources/sql-tests/expressions/math/atan2.sql |
andygrove
reviewed
Apr 2, 2026
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala
Outdated
Show resolved
Hide resolved
andygrove
reviewed
Apr 2, 2026
comphead
reviewed
Apr 3, 2026
comphead
reviewed
Apr 10, 2026
| statement | ||
| INSERT INTO test_atan2 VALUES (0.0, 1.0), (1.0, 0.0), (1.0, 1.0), (-1.0, -1.0), (0.0, 0.0), (NULL, 1.0), (1.0, NULL), (cast('NaN' as double), 1.0), (cast('Infinity' as double), 1.0) | ||
| INSERT INTO test_atan2 VALUES | ||
| (0.0, 0.0), (0.0, -0.0), (0.0, 1.0), (0.0, -1.0), (0.0, NULL), (0.0, cast('NaN' as double)), (0.0, cast('Infinity' as double)), (0.0, cast('-Infinity' as double)), |
comphead
approved these changes
Apr 10, 2026
Contributor
comphead
left a comment
There was a problem hiding this comment.
Thanks @kazuyukitanimura this is LGTM
Contributor
Author
|
Thank you @comphead merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes: #1897
Rationale for this change
#1897 claims
tanis incompatible; however, what is really incompatible isatan2that is failing in the same test in #1896The correct results are
Looks like Spark adds
+0.0to inputs in order to convertatan2(-0.0, -0.0)toatan2(+0.0, +0.0)What changes are included in this PR?
Fixed
atan2and enabledtanHow are these changes tested?