hcrosse opened a new pull request, #1501:
URL: https://github.com/apache/arrow-go/pull/1501

   ### Rationale for this change
   
   Extracting, casting and parsing `decimal32` and `decimal64` scalars fails or 
panics because `arrow/scalar` has no types for them.
   
   ### What changes are included in this PR?
   
   `Decimal32` and `Decimal64` alias one unexported generic type, as 
`array.Decimal32` does. I can switch to concrete structs, or move `Decimal128` 
and `Decimal256` onto it in a separate PR that keeps their casts.
   
   `CastTo` supports string and decimals of equal or greater width. `Validate` 
skips precision checks, matching `Decimal128` and `Decimal256`.
   
   `Decimal32FromString` and `Decimal64FromString` reject malformed text and 
infinities. `decimal256.Rescale` stops panicking, including through 
`Decimal128` and `Decimal256` casts to `decimal256`. The new scalars would 
otherwise reach these crashes.
   
   `MakeScalarParam` now returns decimal scalars for these types instead of 
`Uint32` or `String` scalars. Decimal values with a mismatched type now return 
an error.
   
   ### Are these changes tested?
   
   `TestFromString` and `TestRescale` regression cases fail or panic on main. 
`TestDecimal32And64Scalars` covers the issue's cases through the new 
constructors.
   
   On macOS arm64 with Go 1.26.10, `go test ./arrow/...` with arrow-testing and 
parquet-testing checked out, `-race -tags assert,test` tests, vet, 
`golangci-lint` and the Release Audit Tool passed.
   
   ### Are there any user-facing changes?
   
   Yes. New types and constructors: `Decimal32`, `Decimal64`, 
`NewDecimal32Scalar`, `NewDecimal64Scalar`.
   
   Closes https://github.com/apache/arrow-go/issues/1497.
   


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