shifluxxc opened a new pull request, #19385: URL: https://github.com/apache/datafusion/pull/19385
## Which issue does this PR close? - Closes #19354 ## Rationale for this change `ScalarValue` currently rejects decimals with negative scale, even though negative scales are valid in Arrow and useful for representing scaled integer values (e.g. 10, 100). This limitation prevents correct construction and arithmetic on such decimals. ## What changes are included in this PR? - Remove the restriction that disallowed negative decimal scales in `ScalarValue` - Update decimal construction and rescaling logic to handle signed scales safely - Add validation to prevent overflow and inexact representations ## Are these changes tested? Yes. New unit tests are added for negative-scale decimals, including construction, arithmetic, rescaling, and failure cases. -- 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]
