fivetran-ahmadalhour opened a new pull request, #19143: URL: https://github.com/apache/iceberg/pull/19143
Java writes NaN and ±Infinity float and double field defaults as the JSON strings `"NaN"`, `"Infinity"` and `"-Infinity"`, but reads only JSON numbers. A V3 table that adds such a default commits successfully, and then every later load or schema update fails with `Cannot parse default as a float value: "NaN"`. This change lets `SchemaParser` read exactly those three case-sensitive strings for float and double defaults. Other strings are still rejected, and `SingleValueParser` and its other callers, such as expression parsing, are unchanged. It does not change what Java writes or the spec. Related: #17106. Test plan: - Schema round trip with distinct initial and write defaults for float/double × NaN/+Inf/-Inf, from literal JSON; single-attribute and string-field controls. - Invalid strings (`"nan"`, `"+Infinity"`, `"1.25"`, …) and int fields are still rejected; `SingleValueParser` still rejects `"NaN"` for double. - A metadata fixture written by unpatched `main` loads, survives a serialize/parse round trip with schema history intact, and reuses the schema ID for an equivalent schema. - Avro read of an old data file projects the non-finite initial defaults from the recovered schema. - Catalog V3 commit and reload: add column, update write default, initial default preserved. The REST compatibility kit skips this test until the encoding is specified. - A schema-aware expression with an infinite literal is still rejected. --- **AI Disclosure** - Model: Claude Opus 5.5 - Platform/Tool: Claude Code - Human Oversight: [unknown - human to fill in] - Prompt Summary: Make Java read the NaN/±Infinity default strings it already writes, scoped to schema defaults, with a regression fixture from unpatched main; the parser change and tests are generated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
