jiayuasu opened a new pull request, #3220:
URL: https://github.com/apache/sedona/pull/3220

   ## What changed
   
   - Normalize the selected Moran value column to `DOUBLE` before computing the 
mean and centered-value statistics.
   - Add a regression test covering a `BIGINT` value column, matching the type 
produced by `COUNT(*)`.
   
   ## Why
   
   Moran's I returns its intermediate aggregates through a typed tuple of 
`Double` values. With an integral input column, Spark inferred `z * z` and its 
sum as decimal values, then rejected the attempted upcast from `DECIMAL(38, 
scale)` to `DOUBLE`.
   
   Normalizing the value column at the calculation boundary keeps the 
intermediate expressions consistent with the existing double-based result 
contract. Callers can now pass integer counts without adding their own cast.
   
   ## Validation
   
   - `MoranTest` on Spark 3.4 / Scala 2.12: 5 tests passed.
   - `MoranTest` on Spark 3.5.8 / Scala 2.12: 5 tests passed.
   - `MoranTest` on Spark 4.1.1 / Scala 2.13: 5 tests passed.
   - Repository pre-commit hooks passed.
   
   Fixes #3218.
   


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

Reply via email to