Repository navigation
GH-50230: [C++] Return Invalid status for out-of-range Substrait decimal precision - #54910
xiaobai0529 wants to merge 1 commit into
Conversation
|
Thanks for opening a pull request! This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format. If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or After updating the title, you can mark the pull request as ready for review. See also: |
|
|
|
|
dmitry-chirkov-dremio
left a comment
There was a problem hiding this comment.
Approving as is but additional test cases for boundary conditions would be a cherry on top.
|
|
||
| EXPECT_THAT(DeserializePlan(*Buffer::FromString(std::move(poc)), | ||
| /*registry=*/nullptr, /*ext_set_out=*/nullptr), | ||
| Raises(StatusCode::Invalid, HasSubstr("Decimal precision out of range"))); |
There was a problem hiding this comment.
Let's do a "classic" boundary check tests with 0, 1, 38, or 39, please?
Summary
DeserializePlanfatalARROW_CHECKabort on out-of-range decimal precision (Decimal128Typector viaFromProtoImplmake_shared bypass) #50230.Root cause
The decimal arm used \FromProtoImpl, which constructs the type with \std::make_shared\ and bypasses the validating factory. An untrusted precision of 42 reached the constructor's fatal \ARROW_CHECK_OK, aborting \DeserializePlan\ instead of returning \Status::Invalid.
Fixes #50230
Verification
AI assistance
I used an AI coding assistant for investigation and drafting this patch. I reviewed the final diff and ran the before/after tests locally.
DeserializePlanfatalARROW_CHECKabort on out-of-range decimal precision (Decimal128Typector viaFromProtoImplmake_shared bypass) #50230