Repository navigation
Conversation
WZhuo
marked this pull request as draft
November 19, 2026 04:06
WZhuo
force-pushed
the
fix/decimal-precision-error
branch
4 times, most recently
from
November 20, 2026 04:34
58ce6a2 to
4d4f216
Compare
WZhuo
marked this pull request as ready for review
November 20, 2026 04:37
TypeFromJson passed the parsed precision straight to the DecimalType constructor, whose ICEBERG_CHECK_OR_DIE throws IcebergError when the precision exceeds 38. A type string such as "decimal(39,0)", or a schema or table metadata containing one, threw instead of returning an error. Check the precision against DecimalType::kMaxPrecision before constructing the type and return a JsonParseError. Closes apache#1143.
WZhuo
force-pushed
the
fix/decimal-precision-error
branch
from
November 20, 2026 05:46
4d4f216 to
e216823
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1143.
TypeFromJsonpassed the parsed precision straight to theDecimalTypeconstructor. When the precision is above 38, the constructor'sICEBERG_CHECK_OR_DIEthrowsIcebergError. So"decimal(39,0)", or a schema or table metadata containing it, threw instead of returning an error.This checks the precision against
DecimalType::kMaxPrecisionbefore constructing the type, and returns aJsonParseErrorlike the existing one for a malformed decimal string.TypeJsonTest.InvalidV2Typescollects the error cases for the v1 and v2 types: decimal precision above 38, malformed decimal and fixed strings, an unknown type name, struct, list and map objects missing a required key, and an unknown complex type. Each must return aJsonParseError. It also checks that a schema with adecimal(39, 0)field fails throughSchemaFromJsoninstead of throwing.The iceberg-verification case
types/primitive/decimal-precision-over-38(#1144) passes with this change.