Ryan Skraba created AVRO-4217:
---------------------------------

             Summary: [Spec] Better define floating point numbers in JSON 
encoding
                 Key: AVRO-4217
                 URL: https://issues.apache.org/jira/browse/AVRO-4217
             Project: Apache Avro
          Issue Type: Improvement
          Components: spec
            Reporter: Ryan Skraba
             Fix For: 1.13.0


When encoding and decoding JSON, the SDKs have different behaviours with 
respect to interpreting some IEEE-754 floating point precision values: NaN, 
Inf/Infinity, -Inf/Infinity (maybe positive and negative zeros).

JSON does not define how non-decimal numbers are represented (and it barely 
defines decimal numbers).  Different JSON libraries do their own thing, but we 
should make an effort to specify what we will generate and accept.

I propose modifying the spec to say for the non-decimal string representations 
of floating point precision, Avro will always generate/encode (case-sensitive):

* NaN
* Infinity
* -Infinity

And will accept/decode the following (case-insensitive):

* NAN
* INFINITY, INF
* -INFINITY, -INF



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to