Apache Iceberg version
main (development), commit c4784768b
Query engine
Other: Java API
Please describe the bug
A schema with a double default expressed as JSON 1 fails to parse, while the equivalent 1.0 succeeds.
SchemaParser.fromJson("{\"type\":\"struct\",\"schema-id\":0,\"fields\":["
+ "{\"id\":1,\"name\":\"score\",\"required\":false,"
+ "\"type\":\"double\",\"initial-default\":1}]}");
Actual: IllegalArgumentException: Cannot parse default as a double value: 1.
Expected: a double default of 1.0. Appendix D specifies a JSON number for float/double values, and 1 is a valid numeric representation.
SingleValueParser requires Jackson's isFloatingPointNumber() for float/double, excluding integral numeric nodes. JSON producers may emit these values without a decimal point.
Proposed fix: accept numeric nodes for float/double while retaining rejection of strings and booleans. Cover both types and initial/write defaults through the schema parser.
Willingness to contribute
This report and its reproduction were prepared with AI assistance and verified locally.
Apache Iceberg version
main (development), commit
c4784768bQuery engine
Other: Java API
Please describe the bug
A schema with a double default expressed as JSON
1fails to parse, while the equivalent1.0succeeds.Actual:
IllegalArgumentException: Cannot parse default as a double value: 1.Expected: a double default of
1.0. Appendix D specifies a JSON number for float/double values, and1is a valid numeric representation.SingleValueParserrequires Jackson'sisFloatingPointNumber()for float/double, excluding integral numeric nodes. JSON producers may emit these values without a decimal point.Proposed fix: accept numeric nodes for float/double while retaining rejection of strings and booleans. Cover both types and initial/write defaults through the schema parser.
Willingness to contribute
This report and its reproduction were prepared with AI assistance and verified locally.