xxchan commented on PR #3051:
URL: https://github.com/apache/avro/pull/3051#issuecomment-2254908712
@KalleOlaviNiemitalo I've tested with the java lib. And `"NaN"` is allowed,
but not `NaN`
```java
final String schemaString = "{\"type\" : \"record\", \"name\" : \"R\",\n"
+ " \"fields\" : [ \n {\"name\" : \"f\", \"type\" : \"float\",
\"default\": \"NaN\"}]}";
final Schema schema = new Schema.Parser().parse(schemaString);
```
Note that this is handled inside jackason:
- `"NaN"` is parsed into a `DoubleNode`, and `isNumber` returns `true` in
`isValidDefault` you linked.
- On the contrary, `NaN` will returns exception:
```
org.apache.avro.SchemaParseException:
com.fasterxml.jackson.core.JsonParseException: Non-standard token 'NaN': enable
`JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS` to allow
```
Anyway, thanks for pointing out that Avro IDL is a different thing. I should
have tested with the java lib directly at the beginning :)
--
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]