dtenedor opened a new pull request, #49237:
URL: https://github.com/apache/spark/pull/49237

   ### What changes were proposed in this pull request?
   
   This PR improve type coercion and boundary checking for UNIFORM SQL function.
   
   @srielau found the following issues and wrote them down in SPARK-50561:
   * TINYINT and BIGINT and DECIMAL types were not supported.
   * No type coercion from floating-point numbers was implemented.
   * No explicit error checking for negative numbers was implemented, resulting 
in weird stacktraces instead.
   
   ### Why are the changes needed?
   
   This PR fixes the above problems to make the function work in more cases and 
produce better error messages when it fails.
   
   For example:
   
   ```
   SELECT uniform(cast(10 as decimal(10, 3)), cast(20 as decimal(10, 3)), 0.0D) 
AS result;
   > 17.605
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, see above.
   
   ### How was this patch tested?
   
   This PR adds golden file based test coverage, and updates existing coverage.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to