WZhuo opened a new pull request, #1147:
URL: https://github.com/apache/iceberg-cpp/pull/1147

   Closes #1143.
   
   `TypeFromJson` passed the parsed precision straight to the `DecimalType` 
constructor. When the precision is above 38, the constructor's 
`ICEBERG_CHECK_OR_DIE` throws `IcebergError`. So `"decimal(39,0)"`, or a schema 
or table metadata containing it, threw instead of returning an error.
   
   This checks the precision against `DecimalType::kMaxPrecision` before 
constructing the type, and returns a `JsonParseError` like the existing one for 
a malformed decimal string.
   
   `TypeJsonTest.DecimalPrecisionAboveMaxIsAnError` covers precision 38 
(accepted) and 39 (rejected), both through `TypeFromJson` and inside a schema 
through `SchemaFromJson`.
   
   The iceberg-verification case `types/primitive/decimal-precision-over-38` 
(#1144) passes with this change. `rest_catalog_test` has 3 auth failures 
locally that also occur on unmodified main. All other tests and pre-commit pass.
   


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

Reply via email to