laserninja opened a new issue, #18119:
URL: https://github.com/apache/iceberg/issues/18119

   ### 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.
   
   ```java
   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
   
   - [x] I can contribute a fix for this bug independently
   
   This report and its reproduction were prepared with AI assistance and 
verified locally.
   


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