galaxytemple opened a new pull request, #117:
URL: https://github.com/apache/datafusion-spark/pull/117

   ## Which issue does this PR close?
   - Closes #35.
   - Ported from apache/datafusion#26963.
   
   ## Rationale for this change
   
   In `datafusion-spark`, `atan2` with `-0.0` arguments returns different 
results from Apache Spark:
   - `datafusion-spark`: `atan2(-0.0, -1.0)` returned `-pi`
   - `Spark`: returns `pi` because Spark's code adds `0.0` to both arguments 
before computing atan2, turning `-0.0` into `0.0`.
   
   Matching Spark's exact behavior for Spark compatibility.
   
   ## What changes are included in this PR?
   
   - Add `0.0` to both arguments in `spark_atan2` 
(`crates/spark/src/function/math/atan2.rs`).
   - Update expected value in `atan2.slt` for `atan2(-0.0, -1.0)` to 
`3.141592653589793`.
   - Add test cases in `atan2.slt` for `atan2(0.0, -0.0)` and `atan2(-0.0, 
-0.0)`.
   
   ## What is the testing strategy for this PR?
   
   - Verified query outputs on a local Spark 4.0.0.
   - Tested locally via `cargo test -p datafusion-spark-sqllogictest --test 
sqllogictests -- math/atan2`.
   
   ## Are there any user-facing changes?
   
   `atan2` in `datafusion-spark` now returns Spark-compatible values with 
arguments `-0.0`.


-- 
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]

Reply via email to