pujitha24 opened a new pull request, #26900: URL: https://github.com/apache/datafusion/pull/26900
## Which issue does this PR close? - Closes #26333. ## Rationale for this change Spark's `atan2` adds `0.0` to both arguments, so `-0.0` is treated as `+0.0`. The Spark `atan2` in DataFusion passed arguments straight to Rust's `f64::atan2` (C99 semantics), so e.g. `atan2(-0.0, -1.0)` returned `-pi` where Spark returns `pi`. ## What changes are included in this PR? `spark_atan2` now computes `(y + 0.0).atan2(x + 0.0)`. The `atan2.slt` expectation for `atan2(-0.0, -1.0)` is changed to `pi`, and cases for `atan2(0.0, -0.0)` and `atan2(-0.0, -0.0)` (both `0`, per the issue's Spark results) are added. ## What is the testing strategy for this PR? `cargo test -p datafusion-sqllogictest --test sqllogictests -- spark/math/atan2` fails on the updated slt without the source change and passes with it. `cargo fmt --all` and `cargo clippy -p datafusion-spark --all-targets -- -D warnings` are clean. I did not run Spark itself; expected values come from the issue. ## Are there any user-facing changes? Spark `atan2` results change for `-0.0` inputs, to match Spark. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
