Apache Iceberg version
No response
Please describe the bug 馃悶
The spec requires decimal precision to be 38 or less ("Scale is fixed, precision must be 38 or less"). Parsing the schema type string decimal(39, 0) (or any P > 38) should be rejected, but it is accepted: decimal(39, 0) creates DecimalType(precision=39, scale=0) with no error.
The Java reference implementation rejects it: DecimalType.of(39, 0) raises IllegalArgumentException: Decimals with precision larger than 38 are not supported: 39 (api/.../types/Types.java).
Precision above 38 isn't representable in decimal's fixed-byte storage, so silently accepting it can corrupt downstream encoding.
Expected: reject decimal(P, S) with P > 38 at parse/construction time.
Willingness to contribute
Apache Iceberg version
No response
Please describe the bug 馃悶
The spec requires decimal precision to be 38 or less ("Scale is fixed, precision must be 38 or less"). Parsing the schema type string decimal(39, 0) (or any P > 38) should be rejected, but it is accepted: decimal(39, 0) creates
DecimalType(precision=39, scale=0)with no error.The Java reference implementation rejects it:
DecimalType.of(39, 0)raisesIllegalArgumentException: Decimals with precision larger than 38 are not supported: 39 (api/.../types/Types.java).Precision above 38 isn't representable in decimal's fixed-byte storage, so silently accepting it can corrupt downstream encoding.
Expected: reject decimal(P, S) with P > 38 at parse/construction time.
Willingness to contribute