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

   ### Rationale for this change
   
   Part of #1676. `decimalFromFB` built decimal types directly from the 
flatbuffer fields, so an IPC schema with decimal precision 0 (or above the 
maximum for its width) was accepted. Arrow C++ rejects these. A corpus input 
from arrow-testing (`crash-5e88bae6ac5250714e8c8bc73b9d67b949fadbb4`) hits this 
case.
   
   ### What changes are included in this PR?
   
   - `decimalFromFB` now builds types with `arrow.NewDecimalType`, which 
validates precision per width: 1-9 (decimal32), 1-18 (decimal64), 1-38 
(decimal128), 1-76 (decimal256). These match C++. The error propagates as a 
schema read error. Scale is not checked, as before.
   - `TestDecimalFromFBPrecision`: each width at precision -1, 0, 1, the 
maximum and maximum+1, plus width and negative scale preservation.
   - The `crash-5e88...` input now errors, so it is removed from the `clean` 
map in `TestStreamFuzzRegression`.
   
   The other half of #1676, structural flatbuffer verification, is not 
addressed here. Go flatbuffers v25.12.19 and the generated `flatbuf` code have 
no verifier API. #1676 stays open for it.
   
   ### Are these changes tested?
   
   Yes. `go test -tags assert,test -race ./arrow/ipc/...` passes, as does the 
run without tags. `golangci-lint` reports 0 issues on the changed files.
   
   ### Are there any user-facing changes?
   
   Yes. Readers now return an error for IPC schemas with an out-of-range 
decimal precision instead of accepting them.
   


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